initial text impl
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
use crate::{util::{impl_op, F32Util}, UiNum};
|
||||
use crate::{
|
||||
layout::UiNum,
|
||||
util::{F32Util, impl_op},
|
||||
};
|
||||
use std::ops::*;
|
||||
|
||||
#[repr(C)]
|
||||
@@ -28,6 +31,27 @@ impl Vec2 {
|
||||
y: self.y.lerp(from.y, to.y),
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn round(self) -> Self {
|
||||
Self {
|
||||
x: self.x.round(),
|
||||
y: self.y.round(),
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn floor(self) -> Self {
|
||||
Self {
|
||||
x: self.x.floor(),
|
||||
y: self.y.floor(),
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn ceil(self) -> Self {
|
||||
Self {
|
||||
x: self.x.ceil(),
|
||||
y: self.y.ceil(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl const From<f32> for Vec2 {
|
||||
|
||||
Reference in New Issue
Block a user