1
0
Fork 0
forked from wry/wry

tree: implement pointer constraints

This commit is contained in:
Julian Orth 2022-07-21 20:16:22 +02:00
parent d4c4497043
commit 38d1267ec9
19 changed files with 707 additions and 4 deletions

View file

@ -78,6 +78,18 @@ impl Region {
pub fn extents(&self) -> Rect {
self.extents
}
pub fn contains(&self, x: i32, y: i32) -> bool {
if !self.extents.contains(x, y) {
return false;
}
for r in self.deref() {
if r.contains(x, y) {
return true;
}
}
false
}
}
impl Deref for Region {