pub trait OtRound<U, T = Self> {
fn ot_round(self) -> U;
}
impl OtRound<i16> for f64 {
#[inline]
fn ot_round(self) -> i16 {
(self + 0.5).floor() as i16
}
}
impl OtRound<i16> for f32 {
#[inline]
fn ot_round(self) -> i16 {
(self + 0.5).floor() as i16
}
}
impl OtRound<u16> for f64 {
#[inline]
fn ot_round(self) -> u16 {
(self + 0.5).floor() as u16
}
}
impl OtRound<u16> for f32 {
#[inline]
fn ot_round(self) -> u16 {
(self + 0.5).floor() as u16
}
}
impl OtRound<(i16, i16)> for kurbo::Point {
#[inline]
fn ot_round(self) -> (i16, i16) {
(self.x.ot_round(), self.y.ot_round())
}
}