1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use easygpu_lyon::lyon_tessellation::StrokeOptions;
use figures::Figure;
use crate::{color::Color, math::Scaled};
#[derive(Default, Clone, Debug)]
pub struct Stroke {
pub color: Color,
pub options: StrokeOptions,
}
impl Stroke {
#[must_use]
pub fn new(color: Color) -> Self {
Self {
color,
options: StrokeOptions::default(),
}
}
#[must_use]
pub const fn with_options(mut self, options: StrokeOptions) -> Self {
self.options = options;
self
}
#[must_use]
pub fn line_width<F: Into<Figure<f32, Scaled>>>(mut self, width: F) -> Self {
self.options.line_width = width.into().get();
self
}
}