From a0d092f38ee6ff0333762dd955117f09535d88b9 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sat, 18 Nov 2023 19:37:55 +0100 Subject: [PATCH] Fix panic when resetting areas. Closes #3566 --- crates/egui/src/memory.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/memory.rs b/crates/egui/src/memory.rs index ed1c11df935..973147bdc9e 100644 --- a/crates/egui/src/memory.rs +++ b/crates/egui/src/memory.rs @@ -727,7 +727,9 @@ impl Memory { /// Forget window positions, sizes etc. /// Can be used to auto-layout windows. pub fn reset_areas(&mut self) { - self.areas = Default::default(); + for area in self.areas.values_mut() { + *area = Default::default(); + } } /// Obtain the previous rectangle of an area.