Separate measured-answer dependencies from retained drawing validity

This commit is contained in:
iris-ai committed 2026-09-17 17:10:55 -04:00
1 parent c44bd198ee
commit f860f716e6
7 files changed
+188 -356

No files matched your search

+19
View File
@@ -15,6 +15,25 @@ impl LayoutHolds {
placement: None,
};
pub fn and(self, other: Self) -> Self {
debug_assert!(
self.placement.is_none()
|| other.placement.is_none()
|| self.placement == other.placement
);
Self {
frame: [
self.frame[0].and(other.frame[0]),
self.frame[1].and(other.frame[1]),
],
extent: [
self.extent[0].and(other.extent[0]),
self.extent[1].and(other.extent[1]),
],
placement: self.placement.or(other.placement),
}
}
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| {