pub trait PathBuilder: Default + 'static {
type Path: Path;
// Required methods
fn set_fill_type(&mut self, fill_type: FillType);
fn move_to(&mut self, location: impl Into<PixelPoint>);
fn line_to(&mut self, location: impl Into<PixelPoint>);
fn cubic_curve_to(
&mut self,
control_point_1: impl Into<PixelPoint>,
control_point_2: impl Into<PixelPoint>,
end_point: impl Into<PixelPoint>,
);
fn add_rounded_rect(
&mut self,
rect: impl Into<PixelRect>,
rounding_radii: &RoundingRadii,
);
fn add_oval(&mut self, oval_bounds: impl Into<PixelRect>);
fn add_arc(
&mut self,
oval_bounds: impl Into<PixelRect>,
start_angle_degrees: f32,
end_angle_degrees: f32,
);
fn close(&mut self);
fn build(self) -> Self::Path;
fn build_copy(&mut self) -> Self::Path;
// Provided methods
fn quadratic_curve_to(
&mut self,
control_point: impl Into<PixelPoint>,
end_point: impl Into<PixelPoint>,
) { ... }
fn add_rect(&mut self, rect: impl Into<PixelRect>) { ... }
}Required Associated Types§
Required Methods§
Sourcefn set_fill_type(&mut self, fill_type: FillType)
fn set_fill_type(&mut self, fill_type: FillType)
Sets the fill type.
Sourcefn move_to(&mut self, location: impl Into<PixelPoint>)
fn move_to(&mut self, location: impl Into<PixelPoint>)
Move the cursor to the specified location.
Sourcefn line_to(&mut self, location: impl Into<PixelPoint>)
fn line_to(&mut self, location: impl Into<PixelPoint>)
Add a line segment from the current cursor location to the given location. The cursor location is updated to be at the endpoint.
Sourcefn cubic_curve_to(
&mut self,
control_point_1: impl Into<PixelPoint>,
control_point_2: impl Into<PixelPoint>,
end_point: impl Into<PixelPoint>,
)
fn cubic_curve_to( &mut self, control_point_1: impl Into<PixelPoint>, control_point_2: impl Into<PixelPoint>, end_point: impl Into<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.
Sourcefn add_rounded_rect(
&mut self,
rect: impl Into<PixelRect>,
rounding_radii: &RoundingRadii,
)
fn add_rounded_rect( &mut self, rect: impl Into<PixelRect>, rounding_radii: &RoundingRadii, )
Add a rounded rect with potentially non-uniform radii to the path.
Sourcefn add_arc(
&mut self,
oval_bounds: impl Into<PixelRect>,
start_angle_degrees: f32,
end_angle_degrees: f32,
)
fn add_arc( &mut self, oval_bounds: impl Into<PixelRect>, start_angle_degrees: f32, end_angle_degrees: f32, )
Add an arc to the path.
Sourcefn build_copy(&mut self) -> Self::Path
fn build_copy(&mut self) -> Self::Path
Create a new path by copying the existing built-up path. The existing path can continue being added to.
Provided Methods§
Sourcefn quadratic_curve_to(
&mut self,
control_point: impl Into<PixelPoint>,
end_point: impl Into<PixelPoint>,
)
fn quadratic_curve_to( &mut self, control_point: impl Into<PixelPoint>, end_point: impl Into<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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.