From d3ea922cc6027c1501a07188a721fac0d6ef628d Mon Sep 17 00:00:00 2001 From: "Michael \"Scott\" McBee" Date: Thu, 12 Dec 2024 05:42:32 -0500 Subject: [PATCH] Fix: don't interact with `Area` outside its `constrain_rect` (#5459) * [x] I have followed the instructions in the PR template This PR makes an area's interact rect intersect its constrain rect. This fixes an issue where masked areas would still intercept input. Before: ![before](https://github.com/user-attachments/assets/6b790a04-8a15-44fe-a7ae-4adda189ecba) After: ![after](https://github.com/user-attachments/assets/98010d89-e680-44cb-8717-faf31b0912d3) --- crates/egui/src/containers/area.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/containers/area.rs b/crates/egui/src/containers/area.rs index ab9a0b88d09..a2bfbe1905f 100644 --- a/crates/egui/src/containers/area.rs +++ b/crates/egui/src/containers/area.rs @@ -467,7 +467,7 @@ impl Area { id: interact_id, layer_id, rect: state.rect(), - interact_rect: state.rect(), + interact_rect: state.rect().intersect(constrain_rect), sense, enabled, },