path_kit/direction.rs
1//! 路径绘制方向 (顺时针/逆时针)。Path winding direction (CW/CCW).
2
3use crate::pathkit;
4
5/// 路径绘制方向。Direction for path winding.
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
7pub enum Direction {
8 /// 顺时针 / Clockwise
9 #[default]
10 Cw,
11 /// 逆时针 / Counter-clockwise
12 Ccw,
13}
14
15impl From<Direction> for pathkit::SkPathDirection::Type {
16 fn from(d: Direction) -> Self {
17 match d {
18 Direction::Cw => pathkit::SkPathDirection::kCW,
19 Direction::Ccw => pathkit::SkPathDirection::kCCW,
20 }
21 }
22}