pub struct StrokeStyle2d { /* private fields */ }Expand description
Complete bounded styling for open 2D lines and polylines.
Implementations§
Source§impl StrokeStyle2d
impl StrokeStyle2d
Sourcepub const fn new(width: f32, color: Color) -> Self
pub const fn new(width: f32, color: Color) -> Self
Builds the legacy logical-pixel round-cap joined-strip style.
Sourcepub const fn logical(width: LogicalPixels, color: Color) -> Self
pub const fn logical(width: LogicalPixels, color: Color) -> Self
Builds a validated logical-pixel-width style.
Sourcepub const fn world(width: WorldLength, color: Color) -> Self
pub const fn world(width: WorldLength, color: Color) -> Self
Builds a validated world-unit-width style.
Sourcepub const fn with_cap(self, cap: StrokeCap2d) -> Self
pub const fn with_cap(self, cap: StrokeCap2d) -> Self
Selects the open endpoint presentation.
Sourcepub const fn with_join(self, join: StrokeJoin2d) -> Self
pub const fn with_join(self, join: StrokeJoin2d) -> Self
Selects the connected-segment presentation.
Sourcepub fn with_miter_limit(self, limit: f32) -> Result<Self, StrokeStyleError>
pub fn with_miter_limit(self, limit: f32) -> Result<Self, StrokeStyleError>
Sets the miter-length multiple in 1.0..=1000.0.
Sourcepub const fn with_dash_pattern(self, dash: StrokeDashPattern2d) -> Self
pub const fn with_dash_pattern(self, dash: StrokeDashPattern2d) -> Self
Applies an allocation-free bounded dash pattern.
Sourcepub const fn with_start_marker(self, marker: StrokeMarker2d) -> Self
pub const fn with_start_marker(self, marker: StrokeMarker2d) -> Self
Adds a triangular marker at the first path point using its selected anchor.
Sourcepub const fn with_end_marker(self, marker: StrokeMarker2d) -> Self
pub const fn with_end_marker(self, marker: StrokeMarker2d) -> Self
Adds a triangular marker at the last path point using its selected anchor.
Sourcepub const fn width_mode(self) -> StrokeWidthMode2d
pub const fn width_mode(self) -> StrokeWidthMode2d
Returns whether width is logical-screen or world-space.
Sourcepub const fn cap(self) -> StrokeCap2d
pub const fn cap(self) -> StrokeCap2d
Returns endpoint presentation.
Sourcepub const fn join(self) -> StrokeJoin2d
pub const fn join(self) -> StrokeJoin2d
Returns connected-segment presentation.
Sourcepub const fn miter_limit(self) -> f32
pub const fn miter_limit(self) -> f32
Returns the bounded miter multiple.
Sourcepub const fn dash_pattern(self) -> Option<StrokeDashPattern2d>
pub const fn dash_pattern(self) -> Option<StrokeDashPattern2d>
Returns the optional bounded dash pattern.
Sourcepub const fn start_marker(self) -> Option<StrokeMarker2d>
pub const fn start_marker(self) -> Option<StrokeMarker2d>
Returns the optional first-endpoint marker.
Sourcepub const fn end_marker(self) -> Option<StrokeMarker2d>
pub const fn end_marker(self) -> Option<StrokeMarker2d>
Returns the optional last-endpoint marker.
Trait Implementations§
Source§impl Clone for StrokeStyle2d
impl Clone for StrokeStyle2d
Source§fn clone(&self) -> StrokeStyle2d
fn clone(&self) -> StrokeStyle2d
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more