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
39
40
use crate::point::Vec2DWorld;
use crate::color::Color;
use crate::shape::path::PathCommand;
use crate::geom::Angle;
#[derive(Debug, PartialEq, Clone)]
pub enum DrawCommand {
Path {
color: Color,
commands: Vec<PathCommand>,
thickness: f64,
},
Circle {
center: Vec2DWorld,
radius: f64,
color: Color,
thickness: f64,
},
Ellipse {
center: Vec2DWorld,
semimajor: f64,
semiminor: f64,
angle: Angle,
thickness: f64,
color: Color,
},
}
impl DrawCommand {
pub fn color(&self) -> Color {
match self {
DrawCommand::Path { color, .. } => *color,
DrawCommand::Circle { color, .. } => *color,
DrawCommand::Ellipse { color, .. } => *color,
}
}
}