PathBuilderObject

Trait PathBuilderObject 

Source
pub trait PathBuilderObject {
    // Required methods
    fn set_fill_type(&mut self, fill_type: FillType);
    fn move_to(&mut self, location: PixelPoint);
    fn line_to(&mut self, location: PixelPoint);
    fn quadratic_curve_to(
        &mut self,
        control_point: PixelPoint,
        end_point: PixelPoint,
    );
    fn cubic_curve_to(
        &mut self,
        control_point_1: PixelPoint,
        control_point_2: PixelPoint,
        end_point: PixelPoint,
    );
    fn add_rect(&mut self, rect: PixelRect);
    fn add_rounded_rect(
        &mut self,
        rect: PixelRect,
        rounding_radii: &RoundingRadii,
    );
    fn add_oval(&mut self, oval_bounds: PixelRect);
    fn add_arc(
        &mut self,
        oval_bounds: PixelRect,
        start_angle_degrees: f32,
        end_angle_degrees: f32,
    );
    fn close(&mut self);
    fn build(self) -> Box<dyn PathObject>;
    fn build_copy(&mut self) -> Box<dyn PathObject>;
}

Required Methods§

Source

fn set_fill_type(&mut self, fill_type: FillType)

Sets the fill type.

Source

fn move_to(&mut self, location: PixelPoint)

Move the cursor to the specified location.

Source

fn line_to(&mut self, location: PixelPoint)

Add a line segment from the current cursor location to the given location. The cursor location is updated to be at the endpoint.

Source

fn quadratic_curve_to( &mut self, control_point: PixelPoint, end_point: PixelPoint, )

Add a quadratic bezier curve from whose start point is the cursor to the specified end point using the a single control point. The cursor location is updated to be at the endpoint.

Source

fn cubic_curve_to( &mut self, control_point_1: PixelPoint, control_point_2: PixelPoint, end_point: PixelPoint, )

Add a cubic bezier curve whose start point is current cursor location to the specified end point using the two specified control points. The cursor location is updated to be at the endpoint.

Source

fn add_rect(&mut self, rect: PixelRect)

Adds a rectangle to the path.

Source

fn add_rounded_rect(&mut self, rect: PixelRect, rounding_radii: &RoundingRadii)

Add a rounded rect with potentially non-uniform radii to the path.

Source

fn add_oval(&mut self, oval_bounds: PixelRect)

Add an oval to the path.

Source

fn add_arc( &mut self, oval_bounds: PixelRect, start_angle_degrees: f32, end_angle_degrees: f32, )

Add an arc to the path.

Source

fn close(&mut self)

Close the path.

Source

fn build(self) -> Box<dyn PathObject>

Builds the path.

Source

fn build_copy(&mut self) -> Box<dyn PathObject>

Create a new path by copying the existing built-up path. The existing path can continue being added to.

Implementors§