pub fn ratio(&mut self, axis: Axis, a: NodeId, b: NodeId, ratio: f64, strength: f64) {
        let node_a = self.nodes.get(&a).unwrap();
        let node_b = self.nodes.get(&b).unwrap();
        match axis {
            Axis::X => self
                .solver
                .add_constraint(node_a.width | EQ(strength) | ratio * node_b.width),
            Axis::Y => self
                .solver
                .add_constraint(node_a.height | EQ(strength) | ratio * node_b.height),
            Axis::Z => self
                .solver
                .add_constraint(node_a.depth | EQ(strength) | ratio * node_b.depth),
        }.unwrap();
    }
/// Require that the size of a along a specific axis is ratio times b
Require that the size of a along a specific axis is ratio times b
Require that the size of a along a specific axis is ratio times b
pub fn ratio(&mut self, axis: Axis, a: NodeId, b: NodeId, ratio: f64, strength: f64) {
        let node_a = self.nodes.get(&a).unwrap();
        let node_b = self.nodes.get(&b).unwrap();
        match axis {
            Axis::X => self
                .solver
                .add_constraint(node_a.width | EQ(strength) | ratio * node_b.width),
            Axis::Y => self
                .solver
                .add_constraint(node_a.height | EQ(strength) | ratio * node_b.height),
            Axis::Z => self
                .solver
                .add_constraint(node_a.depth | EQ(strength) | ratio * node_b.depth),
        }.unwrap();
    }
pub fn ratio ( & mut self , axis : Axis , a : NodeId , b : NodeId , ratio : f64 , strength : f64 ) { let node_a = self . nodes . get ( & a ) . unwrap ( ) ; let node_b = self . nodes . get ( & b ) . unwrap ( ) ; match axis { Axis :: X => self . solver . add_constraint ( node_a . width | EQ ( strength ) | ratio * node_b . width ) , Axis :: Y => self . solver . add_constraint ( node_a . height | EQ ( strength ) | ratio * node_b . height ) , Axis :: Z => self . solver . add_constraint ( node_a . depth | EQ ( strength ) | ratio * node_b . depth ) , } . unwrap ( ) ; }
Require that the size of a along a specific axis is ratio times b
Require that the size of a along a specific axis is ratio times b
&mut self
axis
Axis
a
NodeId
b
NodeId
ratio
f64
strength
f64
&mut self
axis
Axis
a
NodeId
b
NodeId
ratio
f64
strength
f64