zen_rs/aspects/
svg.rs

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
41
42
43
44
45
46
47
48
49
50
51
52
//! Svg aspects types

use std::fmt::Display;

/// The stroke-linejoin attribute is a presentation attribute defining the shape to be used at the corners of paths when they are stroked.
///
/// [MDM](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linejoin)
///
/// arcs | bevel |miter | miter-clip | round
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum StrokeLinejoin {
    Arcs,
    Bevel,
    #[default]
    Miter,
    MiterClip,
    Round,
}
impl Display for StrokeLinejoin {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            StrokeLinejoin::Arcs => write!(f, "arcs"),
            StrokeLinejoin::Bevel => write!(f, "bevel"),
            StrokeLinejoin::Miter => write!(f, "miter"),
            StrokeLinejoin::MiterClip => write!(f, "miterClip"),
            StrokeLinejoin::Round => write!(f, "round"),
        }
    }
}

/// The stroke-linecap attribute is a presentation attribute defining the shape to be used at the end of open subpaths when they are stroked.
///
/// [MDM](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap)
///
/// butt | round | square
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum StrokeLinecap {
    #[default]
    Butt,
    Round,
    Square,
}

impl Display for StrokeLinecap {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            StrokeLinecap::Butt => write!(f, "butt"),
            StrokeLinecap::Round => write!(f, "round"),
            StrokeLinecap::Square => write!(f, "square"),
        }
    }
}