pub struct PathBuilder { /* private fields */ }
Expand description
Path builder similar to Canvas/Cairo interface.
Implementations§
Source§impl PathBuilder
impl PathBuilder
pub fn new() -> Self
pub fn from_path(path: Path) -> Self
pub fn push(&mut self, segments: &[Segment], closed: bool)
Sourcepub fn append_svg_path(
&mut self,
string: impl AsRef<[u8]>,
) -> Result<&mut Self, SvgParserError>
pub fn append_svg_path( &mut self, string: impl AsRef<[u8]>, ) -> Result<&mut Self, SvgParserError>
Extend path from string, which is specified in the same format as SVGs path element.
Sourcepub fn move_to(&mut self, p: impl Into<Point>) -> &mut Self
pub fn move_to(&mut self, p: impl Into<Point>) -> &mut Self
Move current position, ending current subpath
Sourcepub fn line_to(&mut self, p: impl Into<Point>) -> &mut Self
pub fn line_to(&mut self, p: impl Into<Point>) -> &mut Self
Add line from the current position to the specified point
Sourcepub fn quad_to(
&mut self,
p1: impl Into<Point>,
p2: impl Into<Point>,
) -> &mut Self
pub fn quad_to( &mut self, p1: impl Into<Point>, p2: impl Into<Point>, ) -> &mut Self
Add quadratic bezier curve
Sourcepub fn quad_smooth_to(&mut self, p2: impl Into<Point>) -> &mut Self
pub fn quad_smooth_to(&mut self, p2: impl Into<Point>) -> &mut Self
Add smooth quadratic bezier curve
Sourcepub fn cubic_to(
&mut self,
p1: impl Into<Point>,
p2: impl Into<Point>,
p3: impl Into<Point>,
) -> &mut Self
pub fn cubic_to( &mut self, p1: impl Into<Point>, p2: impl Into<Point>, p3: impl Into<Point>, ) -> &mut Self
Add cubic bezier curve
Sourcepub fn cubic_smooth_to(
&mut self,
p2: impl Into<Point>,
p3: impl Into<Point>,
) -> &mut Self
pub fn cubic_smooth_to( &mut self, p2: impl Into<Point>, p3: impl Into<Point>, ) -> &mut Self
Add smooth cubic bezier curve
Sourcepub fn arc_to(
&mut self,
radii: impl Into<Point>,
x_axis_rot: Scalar,
large: bool,
sweep: bool,
p: impl Into<Point>,
) -> &mut Self
pub fn arc_to( &mut self, radii: impl Into<Point>, x_axis_rot: Scalar, large: bool, sweep: bool, p: impl Into<Point>, ) -> &mut Self
Add elliptic arc segment
Sourcepub fn circle(&mut self, radius: Scalar) -> &mut Self
pub fn circle(&mut self, radius: Scalar) -> &mut Self
Add circle with the center at current position and provided radius.
Current position is not changed after invocation.
Sourcepub fn rbox(
&mut self,
size: impl Into<Point>,
radii: impl Into<Point>,
) -> &mut Self
pub fn rbox( &mut self, size: impl Into<Point>, radii: impl Into<Point>, ) -> &mut Self
Add box with rounded corners, with current position being low-x and low-y coordinate
Sourcepub fn checkerboard(&mut self, bbox: BBox, cell_size: Scalar) -> &mut Self
pub fn checkerboard(&mut self, bbox: BBox, cell_size: Scalar) -> &mut Self
Create checker board path inside bounding, useful to draw transparent area
Trait Implementations§
Source§impl Clone for PathBuilder
impl Clone for PathBuilder
Source§fn clone(&self) -> PathBuilder
fn clone(&self) -> PathBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for PathBuilder
impl RefUnwindSafe for PathBuilder
impl Send for PathBuilder
impl Sync for PathBuilder
impl Unpin for PathBuilder
impl UnwindSafe for PathBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more