Skip to main content

coffee/graphics/
shape.rs

1use crate::graphics::{Point, Rectangle};
2
3/// A geometric figure.
4#[derive(Debug, Clone, PartialEq)]
5pub enum Shape {
6    /// A rectangle
7    Rectangle(Rectangle<f32>),
8
9    /// A circle
10    Circle {
11        /// The center of the circle
12        center: Point,
13
14        /// The radius of the circle
15        radius: f32,
16    },
17
18    /// An ellipse
19    Ellipse {
20        /// The center of the ellipse
21        center: Point,
22
23        /// The horizontal radius of the ellipse
24        horizontal_radius: f32,
25
26        /// The vertical radius of the ellipse
27        vertical_radius: f32,
28
29        /// The rotation of the ellipse in radians
30        rotation: f32,
31    },
32
33    /// A polyline
34    Polyline {
35        /// The points of the polyline
36        points: Vec<Point>,
37    },
38}