pub struct PathStroke {
pub width: f32,
pub color: ColorMode,
pub kind: StrokeKind,
}
Expand description
Describes the width and color of paths. The color can either be solid or provided by a callback. For more information, see ColorMode
The default stroke is the same as Stroke::NONE
.
Fields§
§width: f32
§color: ColorMode
§kind: StrokeKind
Implementations§
Source§impl PathStroke
impl PathStroke
Sourcepub const NONE: Self = _
pub const NONE: Self = _
Same as PathStroke::default
.
pub fn new(width: impl Into<f32>, color: impl Into<Color32>) -> Self
Sourcepub fn new_uv(
width: impl Into<f32>,
callback: impl Fn(Rect, Pos2) -> Color32 + Send + Sync + 'static,
) -> Self
pub fn new_uv( width: impl Into<f32>, callback: impl Fn(Rect, Pos2) -> Color32 + Send + Sync + 'static, ) -> Self
Create a new PathStroke
with a UV function
The bounding box passed to the callback will have a margin of TessellationOptions::feathering_size_in_pixels
Trait Implementations§
Source§impl Clone for PathStroke
impl Clone for PathStroke
Source§fn clone(&self) -> PathStroke
fn clone(&self) -> PathStroke
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PathStroke
impl Debug for PathStroke
Source§impl Default for PathStroke
impl Default for PathStroke
Source§fn default() -> PathStroke
fn default() -> PathStroke
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PathStroke
impl<'de> Deserialize<'de> for PathStroke
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Color> From<(f32, Color)> for PathStroke
impl<Color> From<(f32, Color)> for PathStroke
Source§impl From<Stroke> for PathStroke
impl From<Stroke> for PathStroke
Source§impl PartialEq for PathStroke
impl PartialEq for PathStroke
Source§impl Serialize for PathStroke
impl Serialize for PathStroke
impl StructuralPartialEq for PathStroke
Auto Trait Implementations§
impl Freeze for PathStroke
impl !RefUnwindSafe for PathStroke
impl Send for PathStroke
impl Sync for PathStroke
impl Unpin for PathStroke
impl !UnwindSafe for PathStroke
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