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

commit366c70a1503a3f911f60263b4d6347e009f99a74
parent953b9dd992
authorLucas Galante <[email protected]>
date2026-07-06 11:55
Fix mouse wheel event propagation to skip viewport backdrop when foreground widget consumes it

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

diff --git a/src/app.rs b/src/app.rs
index dcc0648..c2baf62 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -4045,6 +4045,9 @@ pub(crate) fn geometry_to_spreadsheet_data(geom: &Geometry) -> (Vec<String>, Vec
                         ctx.last_scroll_time = Some(now);
                     }
                     for (i, w) in self.widgets.iter_mut().enumerate() {
+                        if i == VIEWPORT_IDX {
+                            continue;
+                        }
                         if w.mouse_wheel(delta, self.cursor_x, self.cursor_y, ctx) {
                             handled = true;
                             if i == CONTENT_IDX {
@@ -4079,6 +4082,12 @@ pub(crate) fn geometry_to_spreadsheet_data(geom: &Geometry) -> (Vec<String>, Vec
                                 }
                                 needs_sync_grid = true;
                             }
+                            break;
+                        }
+                    }
+                    if !handled {
+                        if self.widgets[VIEWPORT_IDX].mouse_wheel(delta, self.cursor_x, self.cursor_y, ctx) {
+                            handled = true;
                         }
                     }
                 }