pub struct Stroke {
pub width: f32,
pub cap: StrokeCap,
pub join: StrokeJoin,
}Expand description
Describes how an outline is stroked.
The stroke is centered on the geometry: it extends width / 2 to either
side of the path, matching Skia / Jetpack Compose semantics.
Fields§
§width: f32Total stroke width in the caller’s coordinate space (dp for
crate::DrawScope callers).
cap: StrokeCap§join: StrokeJoinImplementations§
Source§impl Stroke
impl Stroke
pub const fn with_width(self, width: f32) -> Self
pub const fn with_cap(self, cap: StrokeCap) -> Self
pub const fn with_join(self, join: StrokeJoin) -> Self
Sourcepub fn half_width(&self) -> f32
pub fn half_width(&self) -> f32
Half the stroke width, clamped to a finite non-negative value.
This is the amount the stroke bleeds outside (and inside) the geometry.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
A stroke is renderable only when it has a strictly positive, finite width.
Trait Implementations§
impl Copy for Stroke
Source§impl RenderHash for Stroke
impl RenderHash for Stroke
fn render_hash(&self) -> u64
impl StructuralPartialEq for Stroke
Auto Trait Implementations§
impl Freeze for Stroke
impl RefUnwindSafe for Stroke
impl Send for Stroke
impl Sync for Stroke
impl Unpin for Stroke
impl UnsafeUnpin for Stroke
impl UnwindSafe for Stroke
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