path_kit/rect_corner.rs
1//! 矩形起始角,指定 add_rect 时从哪个角开始绘制。
2//! Rectangle start corner for add_rect (which corner to begin drawing from).
3
4/// 矩形起始角,指定 add_rect 时从哪个角开始绘制。
5/// Rectangle start corner for add_rect (which corner to begin drawing from).
6#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7#[repr(u32)]
8pub enum RectCorner {
9 /// 左上 / Upper-left
10 UpperLeft = 0,
11 /// 右上 / Upper-right
12 UpperRight = 1,
13 /// 右下 / Lower-right
14 LowerRight = 2,
15 /// 左下 / Lower-left
16 LowerLeft = 3,
17}
18
19impl Default for RectCorner {
20 fn default() -> Self {
21 Self::UpperLeft
22 }
23}
24
25impl From<RectCorner> for u32 {
26 fn from(c: RectCorner) -> Self {
27 c as u32
28 }
29}