pub struct PathShape { /* private fields */ }Expand description
Represents a custom path shape with a fill color and 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.fill: The fill color of the shape.stroke: The stroke properties of the shape.
§Examples
use grafo::{Shape, PathShape};
use grafo::Color;
use grafo::Stroke;
// Replace this with your own path
let path = lyon::path::Path::builder().build();
let path_shape = PathShape::new(
path,
Color::rgb(0, 255, 0), // Green fill
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, fill: Color, stroke: Stroke) -> Self
pub fn new(path: Path, fill: Color, stroke: Stroke) -> Self
Creates a new PathShape with the specified path, fill color, and stroke.
§Parameters
path: The geometric path defining the shape.fill: The fill color of the shape.stroke: The stroke properties of the shape.
§Examples
use grafo::PathShape;
use grafo::Color;
use grafo::Stroke;
use lyon::path::Path;
let path = Path::builder().build();
let path_shape = PathShape::new(path, Color::rgb(0, 255, 0), 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 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