fix incorrect orientation of layer surfaces

top and bottom surfaces were not sized & oriented correctly
closes #3
This commit is contained in:
Ferdinand Schober
2023-09-21 12:35:27 +02:00
parent 48b701b726
commit 08893a39be
2 changed files with 119 additions and 44 deletions

View File

@@ -9,6 +9,18 @@ pub enum Position {
Top,
Bottom,
}
impl Position {
pub fn opposite(&self) -> Self {
match self {
Position::Left => Self::Right,
Position::Right => Self::Left,
Position::Top => Self::Bottom,
Position::Bottom => Self::Top,
}
}
}
impl Display for Position {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", match self {