pub struct PathShape {
pub points: Vec<Pos2, Global>,
pub closed: bool,
pub fill: Color32,
pub stroke: Stroke,
}
Expand description
A path which can be stroked and/or filled (if closed).
Fields
points: Vec<Pos2, Global>
Filled paths should prefer clockwise order.
closed: bool
If true, connect the first and last of the points together.
This is required if fill != TRANSPARENT
.
fill: Color32
Fill is only supported for convex polygons.
stroke: Stroke
Color and thickness of the line.
Implementations
sourceimpl PathShape
impl PathShape
sourcepub fn line(points: Vec<Pos2, Global>, stroke: impl Into<Stroke>) -> PathShape
pub fn line(points: Vec<Pos2, Global>, stroke: impl Into<Stroke>) -> PathShape
A line through many points.
Use Shape::line_segment
instead if your line only connects two points.
sourcepub fn closed_line(
points: Vec<Pos2, Global>,
stroke: impl Into<Stroke>
) -> PathShape
pub fn closed_line(
points: Vec<Pos2, Global>,
stroke: impl Into<Stroke>
) -> PathShape
A line that closes back to the start point again.
sourcepub fn convex_polygon(
points: Vec<Pos2, Global>,
fill: impl Into<Color32>,
stroke: impl Into<Stroke>
) -> PathShape
pub fn convex_polygon(
points: Vec<Pos2, Global>,
fill: impl Into<Color32>,
stroke: impl Into<Stroke>
) -> PathShape
A convex polygon with a fill and optional stroke.
The most performant winding order is clockwise.
sourcepub fn visual_bounding_rect(&self) -> Rect
pub fn visual_bounding_rect(&self) -> Rect
The visual bounding rectangle (includes stroke width)
Trait Implementations
impl StructuralPartialEq for PathShape
Auto Trait Implementations
impl RefUnwindSafe for PathShape
impl Send for PathShape
impl Sync for PathShape
impl Unpin for PathShape
impl UnwindSafe for PathShape
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more