/// Return an x, y position for a point, or one of its handles. If called with
/// WhichHandle::Neither, return position for point.
Return an x, y position for a point, or one of its handles. If called with
WhichHandle::Neither, return position for point.
Return an x y position for a point or one of its handles . If called with WhichHandle :: Neither return position for point .
pub fn handle_or_colocated(
        &self,
        which: WhichHandle,
        transform_x: fn(f32) -> f32,
        transform_y: fn(f32) -> f32,
    ) -> (f32, f32) {
        let handle = match which {
            WhichHandle::A => self.a,
            WhichHandle::B => self.b,
            WhichHandle::Neither => Handle::Colocated,
        };
        match handle {
            Handle::At(x, y) => (transform_x(x), transform_y(y)),
            Handle::Colocated => (transform_x(self.x), transform_y(self.y)),
        }
    }
pub fn handle_or_colocated ( & self , which : WhichHandle , transform_x : fn ( f32 ) -> f32 , transform_y : fn ( f32 ) -> f32 , ) -> ( f32 , f32 ) { let handle = match which { WhichHandle :: A => self . a , WhichHandle :: B => self . b , WhichHandle :: Neither => Handle :: Colocated , } ; match handle { Handle :: At ( x , y ) => ( transform_x ( x ) , transform_y ( y ) ) , Handle :: Colocated => ( transform_x ( self . x ) , transform_y ( self . y ) ) , } }
Return an x, y position for a point, or one of its handles.
Return an x y position for a point or one of its handles .
&self
which
WhichHandle
transform_x
fn(f32) -> f32
transform_y
fn(f32) -> f32