pub struct PathShape { /* private fields */ }Expand description
Represents a custom path shape with stroke.
You typically do not need to use PathShape directly; instead, use the Shape::builder
method to construct complex shapes.
§Fields
path: The geometric path defining the shape.stroke: The stroke properties of the shape.
§Examples
use grafo::{Shape, PathShape};
use grafo::Stroke;
use grafo::Color;
// Replace this with your own path
let path = lyon::path::Path::builder().build();
let path_shape = PathShape::new(
path,
Stroke::new(1.0, Color::BLACK), // Black stroke with width 1.0
);
let shape = Shape::Path(path_shape);Implementations§
Source§impl PathShape
impl PathShape
Sourcepub fn new(path: Path, stroke: Stroke) -> Self
pub fn new(path: Path, stroke: Stroke) -> Self
Creates a new PathShape with the specified path and stroke.
§Parameters
path: The geometric path defining the shape.stroke: The stroke properties of the shape.
§Examples
use grafo::PathShape;
use grafo::Stroke;
use lyon::path::Path;
let path = Path::builder().build();
let path_shape = PathShape::new(path, Stroke::default());Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathShape
impl RefUnwindSafe for PathShape
impl Send for PathShape
impl Sync for PathShape
impl Unpin for PathShape
impl UnsafeUnpin for PathShape
impl UnwindSafe for PathShape
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