tree: implement pointer constraints
This commit is contained in:
parent
d4c4497043
commit
38d1267ec9
19 changed files with 707 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue