Keep valid layout guarantees when a redraw widens their range
This commit is contained in:
1 parent
f860f716e6
commit
0e107f0e89
3 files changed
+46
-1
No files matched your search
@@ -34,6 +34,17 @@ impl LayoutHolds {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn covers(self, other: Self) -> bool {
|
||||
self.placement
|
||||
.is_none_or(|placement| other.placement == Some(placement))
|
||||
&& [0, 1].into_iter().all(|n| {
|
||||
self.frame[n].lo <= other.frame[n].lo
|
||||
&& self.frame[n].hi >= other.frame[n].hi
|
||||
&& self.extent[n].lo <= other.extent[n].lo
|
||||
&& self.extent[n].hi >= other.extent[n].hi
|
||||
})
|
||||
}
|
||||
|
||||
pub fn contains(self, px: PxVec2, placement: UiRegion) -> bool {
|
||||
self.placement.is_none_or(|old| old == placement)
|
||||
&& [Axis::X, Axis::Y].into_iter().all(|axis| {
|
||||
|
||||
Reference in new issue
Block a user