use super::DrawOrder;
impl DrawOrder {
pub const DEFAULT_IMAGE: DrawOrder = DrawOrder(-10.0);
pub const DEFAULT_BOX2D: DrawOrder = DrawOrder(10.0);
pub const DEFAULT_LINES2D: DrawOrder = DrawOrder(20.0);
pub const DEFAULT_POINTS2D: DrawOrder = DrawOrder(30.0);
}
impl std::cmp::PartialEq for DrawOrder {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.0.is_nan() && other.0.is_nan() || self.0 == other.0
}
}
impl std::cmp::Eq for DrawOrder {}
impl std::cmp::PartialOrd for DrawOrder {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}
impl std::cmp::Ord for DrawOrder {
#[inline]
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
if other == self {
std::cmp::Ordering::Equal
} else if other.0.is_nan() || self.0 < other.0 {
std::cmp::Ordering::Less
} else {
std::cmp::Ordering::Greater
}
}
}