pub struct Path { /* private fields */ }Available on crate feature
canvas only.Expand description
An immutable set of points that may or may not be connected.
A single Path can represent different kinds of 2D shapes!
Implementations§
Source§impl Path
impl Path
Sourcepub fn line(from: Point, to: Point) -> Path
pub fn line(from: Point, to: Point) -> Path
Creates a new Path representing a line segment given its starting
and end points.
Sourcepub fn rectangle(top_left: Point, size: Size) -> Path
pub fn rectangle(top_left: Point, size: Size) -> Path
Creates a new Path representing a rectangle given its top-left
corner coordinate and its Size.
Sourcepub fn rounded_rectangle(top_left: Point, size: Size, radius: Radius) -> Path
pub fn rounded_rectangle(top_left: Point, size: Size, radius: Radius) -> Path
Creates a new Path representing a rounded rectangle given its top-left
corner coordinate, its Size and border::Radius.
Sourcepub fn circle(center: Point, radius: f32) -> Path
pub fn circle(center: Point, radius: f32) -> Path
Creates a new Path representing a circle given its center
coordinate and its radius.
Sourcepub fn raw(&self) -> &Path
pub fn raw(&self) -> &Path
Returns the internal lyon_path::Path.
Sourcepub fn transform(
&self,
transform: &Transform2D<f32, UnknownUnit, UnknownUnit>,
) -> Path
pub fn transform( &self, transform: &Transform2D<f32, UnknownUnit, UnknownUnit>, ) -> Path
Returns the current Path with the given transform applied to it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnsafeUnpin for Path
impl UnwindSafe for Path
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