pub fn cubic(
        &mut self,
        control_x1: f64,
        control_y1: f64,
        control_x2: f64,
        control_y2: f64,
        x: f64,
        y: f64,
    ) {
        if let Some(last_pos) = self.last_pos {
            let cubic = PathItem::Cubic(Cubic {
                start: last_pos,
                end: Point(x, y),
                control1: Point(control_x1, control_y1),
                control2: Point(control_x2, control_y2),
            });
            let left_point = cubic.left_point();
            if last_pos != left_point {
                self.push(PathItem::Line(Line(last_pos, left_point)));
            }
            self.set_pos(cubic.right_point());
            self.push(cubic);
        } else {
            panic!("PathBuilder::move_to() is required before cubic");
        }
    }
/// Add a cubic bezier curve.
Add a cubic bezier curve.
Add a cubic bezier curve .
pub fn cubic(
        &mut self,
        control_x1: f64,
        control_y1: f64,
        control_x2: f64,
        control_y2: f64,
        x: f64,
        y: f64,
    ) {
        if let Some(last_pos) = self.last_pos {
            let cubic = PathItem::Cubic(Cubic {
                start: last_pos,
                end: Point(x, y),
                control1: Point(control_x1, control_y1),
                control2: Point(control_x2, control_y2),
            });
            let left_point = cubic.left_point();
            if last_pos != left_point {
                self.push(PathItem::Line(Line(last_pos, left_point)));
            }
            self.set_pos(cubic.right_point());
            self.push(cubic);
        } else {
            panic!("PathBuilder::move_to() is required before cubic");
        }
    }
pub fn cubic ( & mut self , control_x1 : f64 , control_y1 : f64 , control_x2 : f64 , control_y2 : f64 , x : f64 , y : f64 , ) { if let Some ( last_pos ) = self . last_pos { let cubic = PathItem :: Cubic ( Cubic { start : last_pos , end : Point ( x , y ) , control1 : Point ( control_x1 , control_y1 ) , control2 : Point ( control_x2 , control_y2 ) , } ) ; let left_point = cubic . left_point ( ) ; if last_pos != left_point { self . push ( PathItem :: Line ( Line ( last_pos , left_point ) ) ) ; } self . set_pos ( cubic . right_point ( ) ) ; self . push ( cubic ) ; } else { panic ! ( " " ) ; } }
Add a cubic bezier curve.
Add a cubic bezier curve .
&mut self
control_x1
f64
control_y1
f64
control_x2
f64
control_y2
f64
x
f64
y
f64