pub struct PathBuilder { /* private fields */ }Expand description
A builder for paths.
Implementations§
Source§impl PathBuilder
impl PathBuilder
Sourcepub fn line_to(self, x: f32, y: f32) -> Self
pub fn line_to(self, x: f32, y: f32) -> Self
Adds a line segment from the current point to x, y.
Sourcepub fn quad_to(self, cx: f32, cy: f32, x: f32, y: f32) -> Self
pub fn quad_to(self, cx: f32, cy: f32, x: f32, y: f32) -> Self
Adds a quadratic bezier from the current point to x, y,
using a control point of cx, cy.
Sourcepub fn cubic_to(
self,
x: f32,
y: f32,
cx1: f32,
cy1: f32,
cx2: f32,
cy2: f32,
) -> Self
pub fn cubic_to( self, x: f32, y: f32, cx1: f32, cy1: f32, cx2: f32, cy2: f32, ) -> Self
Adds a cubic bezier from the current point to x, y,
using control points cx1, cy1 and cx2, cy2.
Sourcepub fn arc(
self,
x: f32,
y: f32,
radius: f32,
start_angle: f32,
sweep_angle: f32,
) -> Self
pub fn arc( self, x: f32, y: f32, radius: f32, start_angle: f32, sweep_angle: f32, ) -> Self
Adds an arc approximated by quadratic beziers with center x, y
and radius r starting at start_angle and sweeping by sweep_angle.
For a positive sweep_angle the sweep is done clockwise, for a negative
sweep_angle the sweep is done counterclockwise.
Trait Implementations§
Source§impl Debug for PathBuilder
impl Debug for PathBuilder
Source§impl Default for PathBuilder
impl Default for PathBuilder
Source§fn default() -> PathBuilder
fn default() -> PathBuilder
Returns the “default value” for a type. Read more
Auto 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