From 57e5f8b82f239c6f0e0f953da821218e09451c0b Mon Sep 17 00:00:00 2001 From: Linus Behrbohm Date: Fri, 23 Jul 2021 21:41:26 +0200 Subject: [PATCH] Only add resize radius for interactable areas Fixes #576 --- egui/src/memory.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/egui/src/memory.rs b/egui/src/memory.rs index de74d160fab3..54f4eb38f34d 100644 --- a/egui/src/memory.rs +++ b/egui/src/memory.rs @@ -473,13 +473,13 @@ impl Areas { for layer in self.order.iter().rev() { if self.is_visible(layer) { if let Some(state) = self.areas.get(&layer.id) { + let mut rect = Rect::from_min_size(state.pos, state.size); if state.interactable { - let rect = Rect::from_min_size(state.pos, state.size); // Allow us to resize by dragging just outside the window: - let rect = rect.expand(resize_interact_radius_side); - if rect.contains(pos) { - return Some(*layer); - } + rect = rect.expand(resize_interact_radius_side); + } + if rect.contains(pos) { + return Some(*layer); } } }