mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Fix precision issue in panel space allocation debug sanity check
Closes https://github.com/emilk/egui/issues/99
This commit is contained in:
@@ -93,8 +93,8 @@ impl FrameState {
|
||||
/// Shrink `available_rect`.
|
||||
pub(crate) fn allocate_left_panel(&mut self, panel_rect: Rect) {
|
||||
debug_assert!(
|
||||
panel_rect.min == self.available_rect.min,
|
||||
"Mismatching panels. You must not create a panel from within another panel."
|
||||
panel_rect.min.distance(self.available_rect.min) < 0.1,
|
||||
"Mismatching left panel. You must not create a panel from within another panel."
|
||||
);
|
||||
self.available_rect.min.x = panel_rect.max.x;
|
||||
self.unused_rect.min.x = panel_rect.max.x;
|
||||
@@ -104,8 +104,8 @@ impl FrameState {
|
||||
/// Shrink `available_rect`.
|
||||
pub(crate) fn allocate_top_panel(&mut self, panel_rect: Rect) {
|
||||
debug_assert!(
|
||||
panel_rect.min == self.available_rect.min,
|
||||
"Mismatching panels. You must not create a panel from within another panel."
|
||||
panel_rect.min.distance(self.available_rect.min) < 0.1,
|
||||
"Mismatching top panel. You must not create a panel from within another panel."
|
||||
);
|
||||
self.available_rect.min.y = panel_rect.max.y;
|
||||
self.unused_rect.min.y = panel_rect.max.y;
|
||||
|
||||
Reference in New Issue
Block a user