preparation

This commit is contained in:
2025-09-09 21:53:32 -04:00
parent 15cc91d92a
commit 709a2d0e17
14 changed files with 292 additions and 220 deletions

View File

@@ -181,8 +181,8 @@ impl UiRegion {
self
}
pub fn to_screen(&self, size: Vec2) -> ScreenRect {
ScreenRect {
pub fn to_screen(&self, size: Vec2) -> ScreenRegion {
ScreenRegion {
top_left: self.top_left.anchor * size + self.top_left.offset,
bot_right: self.bot_right.anchor * size + self.bot_right.offset,
}
@@ -213,11 +213,11 @@ impl UiRegion {
}
#[derive(Debug)]
pub struct ScreenRect {
top_left: Vec2,
bot_right: Vec2,
pub struct ScreenRegion {
pub top_left: Vec2,
pub bot_right: Vec2,
}
impl ScreenRect {
impl ScreenRegion {
pub fn contains(&self, pos: Vec2) -> bool {
pos.x >= self.top_left.x
&& pos.x <= self.bot_right.x