pub struct StrokeStyle {
pub color: Color,
pub width: f32,
pub cap: LineCap,
pub join: LineJoin,
pub miter_limit: f32,
}Expand description
Stroke styling for polylines and future path primitives.
§Examples
use ailloli_ui_core::{Color, StrokeStyle};
let stroke = StrokeStyle::new(2.0, Color::WHITE);
assert_eq!(stroke.width, 2.0);Fields§
§color: ColorLinear-RGBA stroke color.
width: f32Requested width in logical pixels.
cap: LineCapEndpoint shape for open paths.
join: LineJoinShape joining adjacent path segments.
miter_limit: f32Miter-length ratio limit used only with LineJoin::Miter.
Implementations§
Source§impl StrokeStyle
impl StrokeStyle
Sourcepub fn new(width: f32, color: Color) -> Self
pub fn new(width: f32, color: Color) -> Self
Creates a stroke with caller width/color and the remaining defaults.
Width is stored verbatim; negative or non-finite values are left for the renderer to reject or normalize.
§Examples
use ailloli_ui_core::{Color, LineCap, StrokeStyle};
let stroke = StrokeStyle::new(2.0, Color::WHITE);
assert_eq!((stroke.width, stroke.cap), (2.0, LineCap::Butt));Trait Implementations§
Source§impl Clone for StrokeStyle
impl Clone for StrokeStyle
Source§fn clone(&self) -> StrokeStyle
fn clone(&self) -> StrokeStyle
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 StrokeStyle
impl Debug for StrokeStyle
Source§impl Default for StrokeStyle
impl Default for StrokeStyle
Source§impl PartialEq for StrokeStyle
impl PartialEq for StrokeStyle
impl Copy for StrokeStyle
impl StructuralPartialEq for StrokeStyle
Auto Trait Implementations§
impl Freeze for StrokeStyle
impl RefUnwindSafe for StrokeStyle
impl Send for StrokeStyle
impl Sync for StrokeStyle
impl Unpin for StrokeStyle
impl UnwindSafe for StrokeStyle
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