Nacre/vendor/epaint/src/direction.rs
astar76 8b2b2a5655 S003: first launch on Xvfb, smoke harness, epaint glyph panic and quit segfault fixed
- tools/smoke.sh + tests/smoke/{launch,https,restore}.txt: hidden Xvfb run with a throwaway home
- vendor/epaint: render glyphs single-threaded (Servo enables vello_cpu/multithreading), D-006
- App::quit drops every Servo handle before the GL contexts, so Servo shuts down cleanly
- D-005: smoke runs use Xvfb

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 18:01:15 -06:00

27 lines
832 B
Rust

/// A cardinal direction, one of [`LeftToRight`](Direction::LeftToRight), [`RightToLeft`](Direction::RightToLeft), [`TopDown`](Direction::TopDown), [`BottomUp`](Direction::BottomUp).
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub enum Direction {
LeftToRight,
RightToLeft,
TopDown,
BottomUp,
}
impl Direction {
#[inline(always)]
pub fn is_horizontal(self) -> bool {
match self {
Self::LeftToRight | Self::RightToLeft => true,
Self::TopDown | Self::BottomUp => false,
}
}
#[inline(always)]
pub fn is_vertical(self) -> bool {
match self {
Self::LeftToRight | Self::RightToLeft => false,
Self::TopDown | Self::BottomUp => true,
}
}
}