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) -> StrokeStyle2d
pub const fn new(width: f32, color: Color) -> StrokeStyle2d
Builds the legacy logical-pixel round-cap joined-strip style.
Sourcepub const fn logical(width: LogicalPixels, color: Color) -> StrokeStyle2d
pub const fn logical(width: LogicalPixels, color: Color) -> StrokeStyle2d
Builds a validated logical-pixel-width style.
Sourcepub const fn world(width: WorldLength, color: Color) -> StrokeStyle2d
pub const fn world(width: WorldLength, color: Color) -> StrokeStyle2d
Builds a validated world-unit-width style.
Sourcepub const fn with_cap(self, cap: StrokeCap2d) -> StrokeStyle2d
pub const fn with_cap(self, cap: StrokeCap2d) -> StrokeStyle2d
Selects the open endpoint presentation.
Sourcepub const fn with_join(self, join: StrokeJoin2d) -> StrokeStyle2d
pub const fn with_join(self, join: StrokeJoin2d) -> StrokeStyle2d
Selects the connected-segment presentation.
Sourcepub fn with_miter_limit(
self,
limit: f32,
) -> Result<StrokeStyle2d, StrokeStyleError>
pub fn with_miter_limit( self, limit: f32, ) -> Result<StrokeStyle2d, StrokeStyleError>
Sets the miter-length multiple in 1.0..=1000.0.
Sourcepub const fn with_dash_pattern(self, dash: StrokeDashPattern2d) -> StrokeStyle2d
pub const fn with_dash_pattern(self, dash: StrokeDashPattern2d) -> StrokeStyle2d
Applies an allocation-free bounded dash pattern.
Sourcepub const fn with_start_marker(self, marker: StrokeMarker2d) -> StrokeStyle2d
pub const fn with_start_marker(self, marker: StrokeMarker2d) -> StrokeStyle2d
Adds a triangular marker at the first path point using its selected anchor.
Sourcepub const fn with_end_marker(self, marker: StrokeMarker2d) -> StrokeStyle2d
pub const fn with_end_marker(self, marker: StrokeMarker2d) -> StrokeStyle2d
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 moreimpl Copy for StrokeStyle2d
Source§impl Debug for StrokeStyle2d
impl Debug for StrokeStyle2d
Source§impl PartialEq for StrokeStyle2d
impl PartialEq for StrokeStyle2d
impl StructuralPartialEq for StrokeStyle2d
Auto Trait Implementations§
impl Forget for StrokeStyle2d
impl Freeze for StrokeStyle2d
impl Move for StrokeStyle2d
impl RefUnwindSafe for StrokeStyle2d
impl Send for StrokeStyle2d
impl Sync for StrokeStyle2d
impl Unpin for StrokeStyle2d
impl UnsafeUnpin for StrokeStyle2d
impl UnwindSafe for StrokeStyle2d
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.