preparation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user