Pointer
This commit is contained in:
@@ -44,6 +44,13 @@ impl Rect {
|
||||
size: UiSize::new(width, height),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn contains(self, point: Point) -> bool {
|
||||
point.x >= self.origin.x
|
||||
&& point.y >= self.origin.y
|
||||
&& point.x < self.origin.x + self.size.width
|
||||
&& point.y < self.origin.y + self.size.height
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
|
||||
Reference in New Issue
Block a user