clean up
This commit is contained in:
@@ -88,11 +88,6 @@ impl UiPos {
|
||||
pub fn to_size(&self, size: Vec2) -> Vec2 {
|
||||
self.anchor * size + self.offset
|
||||
}
|
||||
|
||||
/// snaps this to a specific screen size to get actual pixel coordinates
|
||||
pub fn snap(&self, size: Vec2) -> Vec2 {
|
||||
self.to_size(size).round()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
@@ -195,6 +190,10 @@ impl UiRegion {
|
||||
pub fn center(&self) -> UiPos {
|
||||
UiPos::center().within(self)
|
||||
}
|
||||
|
||||
pub fn in_size(&self, size: Vec2) -> Vec2 {
|
||||
self.bot_right.to_size(size) - self.top_left.to_size(size)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
||||
Reference in New Issue
Block a user