git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commitde3a03cdbe6fc8e2577ccd1af2e6a5fd92855559
parentfdd1b217d8
authorLucas Galante <[email protected]>
date2026-07-31 14:29
fix: dismissing the viewport context menu erases it immediately

A left press outside the menu closed it but fell through, and when the
underlying press handled nothing the frame never redrew — the menu
stayed painted until the next incidental redraw. The dismissing left
press is now swallowed: it no longer also orbits/clicks what sits
underneath, and returning handled forces the erasing redraw.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/app.rs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/app.rs b/src/app.rs
index 65c7cc9..b29db9c 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -4379,6 +4379,14 @@ pub(crate) fn geometry_to_spreadsheet_data(geom: &Geometry) -> (Vec<String>, Vec
                                 return true;
                             }
                             self.close_viewport_menu();
+                            // Swallow the dismissing left press: it should not
+                            // also orbit/click whatever sits underneath, and
+                            // returning true forces the redraw that actually
+                            // erases the menu — falling through here left the
+                            // menu painted until the next incidental redraw.
+                            if *button == MouseButton::Left {
+                                return true;
+                            }
                         }
 
                         let hits_any_menu = (0..WIDGET_COUNT).any(|i| {