pub struct Stroke {
pub width: f32,
pub paint: Paint,
pub cap: Cap,
pub join: Join,
pub dash: Vec<f32>,
pub dash_offset: f32,
}Expand description
How a Canvas draws along a path: its width in logical pixels, its
paint, its ends, its corners and its dashes.
use crabshell_ui::{Cap, Color, Join, Stroke};
let ring = Stroke::new(4.0, Color::hex("#89b4fa")).cap(Cap::Round);
let grid = Stroke::new(1.0, Color::rgba(255, 255, 255, 40)).dash(&[4.0, 2.0], 0.0);
let line = Stroke::new(2.0, Color::hex("#a6e3a1")).join(Join::Round);Fields§
§width: f32How wide it is. 0 draws nothing.
paint: PaintWhat it is painted with.
cap: CapHow its open ends look.
join: JoinHow it turns corners.
dash: Vec<f32>The lengths of its dashes and the gaps between them, in turn, or
empty for a solid line. An odd list is repeated, as an HTML
canvas’s setLineDash does.
dash_offset: f32How far into the dash pattern the stroke starts.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Stroke
Auto Trait Implementations§
impl Forget for Stroke
impl Freeze for Stroke
impl Move 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