From 34a11fefd23682651934154af7d540576743725c Mon Sep 17 00:00:00 2001 From: Linus Behrbohm Date: Sun, 15 Aug 2021 16:48:15 +0200 Subject: [PATCH] Only add resize radius for interactable areas (#577) 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 de74d160fab..54f4eb38f34 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); } } }