pub struct PathBuilder { /* private fields */ }Expand description
A path builder.
Implementations§
Source§impl PathBuilder
impl PathBuilder
pub fn new() -> Self
Sourcepub fn quad_to(&mut self, cx: f32, cy: f32, x: f32, y: f32) -> &mut Self
pub fn quad_to(&mut self, cx: f32, cy: f32, x: f32, y: f32) -> &mut Self
A quadratic Bézier curve.
Sourcepub fn cubic_to(
&mut self,
c1x: f32,
c1y: f32,
c2x: f32,
c2y: f32,
x: f32,
y: f32,
) -> &mut Self
pub fn cubic_to( &mut self, c1x: f32, c1y: f32, c2x: f32, c2y: f32, x: f32, y: f32, ) -> &mut Self
A cubic Bézier curve.
Sourcepub fn push_rect(&mut self, rect: Rect) -> &mut Self
pub fn push_rect(&mut self, rect: Rect) -> &mut Self
Adds a rectangular contour (clockwise in screen coordinates).
Sourcepub fn push_round_rect(&mut self, rect: Rect, radius: f32) -> &mut Self
pub fn push_round_rect(&mut self, rect: Rect, radius: f32) -> &mut Self
Adds a rectangle with rounded corners (cubic arcs).
radius is clamped to half of the shorter side. With a zero radius,
a plain rectangle is added.
Sourcepub fn push_oval(&mut self, rect: Rect) -> &mut Self
pub fn push_oval(&mut self, rect: Rect) -> &mut Self
Adds an ellipse inscribed in a rectangle using four cubic arcs.
Sourcepub fn push_circle(&mut self, cx: f32, cy: f32, r: f32) -> &mut Self
pub fn push_circle(&mut self, cx: f32, cy: f32, r: f32) -> &mut Self
Adds a circle.
Sourcepub fn finish(self) -> Option<Path>
pub fn finish(self) -> Option<Path>
Finishes building and returns a Path. None if the path is empty.
Sourcepub fn from_round_rect(rect: Rect, radius: f32) -> Path
pub fn from_round_rect(rect: Rect, radius: f32) -> Path
Quick creation of a rounded rectangle path.
Trait Implementations§
Source§impl Clone for PathBuilder
impl Clone for PathBuilder
Source§fn clone(&self) -> PathBuilder
fn clone(&self) -> PathBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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 UnsafeUnpin 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