fixed the vector method of the kartesiandirection
Dieser Commit ist enthalten in:
Ursprung
855772e976
Commit
2bbf7c86f6
1 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen
12
src/lib.rs
12
src/lib.rs
|
@ -58,21 +58,21 @@ enum KartesianDirection {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl KartesianDirection {
|
impl KartesianDirection {
|
||||||
fn vector<T: Signed + Integer + Zero + From<i8>>(self) -> Kartesian<T> {
|
pub fn vector<T: Signed + Integer + Zero + From<i8>>(self) -> Kartesian<T> {
|
||||||
const BELOW: i8 = -1;
|
const BELOW: i8 = -1;
|
||||||
const ON: i8 = 0;
|
const ON: i8 = 0;
|
||||||
const UPPER: i8 = 1;
|
const UPPER: i8 = 1;
|
||||||
Kartesian::<T> {
|
Kartesian::<T> {
|
||||||
x: match self {
|
x: match self {
|
||||||
Self::TopLeft | Self::Left | Self::BottomLeft => BELOW.into(),
|
|
||||||
Self::Top | Self::None | Self::Bottom => ON.into(),
|
|
||||||
Self::TopRight | Self::Right | Self::BottomRight => UPPER.into(),
|
|
||||||
},
|
|
||||||
y: match self {
|
|
||||||
Self::TopLeft | Self::Top | Self::TopRight => BELOW.into(),
|
Self::TopLeft | Self::Top | Self::TopRight => BELOW.into(),
|
||||||
Self::Left | Self::None | Self::Right => ON.into(),
|
Self::Left | Self::None | Self::Right => ON.into(),
|
||||||
Self::BottomLeft | Self::Bottom | Self::BottomRight => UPPER.into(),
|
Self::BottomLeft | Self::Bottom | Self::BottomRight => UPPER.into(),
|
||||||
},
|
},
|
||||||
|
y: match self {
|
||||||
|
Self::TopLeft | Self::Left | Self::BottomLeft => BELOW.into(),
|
||||||
|
Self::Top | Self::None | Self::Bottom => ON.into(),
|
||||||
|
Self::TopRight | Self::Right | Self::BottomRight => UPPER.into(),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Laden …
Tabelle hinzufügen
In neuem Issue referenzieren