diff --git a/lightningbeam-ui/lightningbeam-editor/src/main.rs b/lightningbeam-ui/lightningbeam-editor/src/main.rs index 066b4b8..d273fa3 100644 --- a/lightningbeam-ui/lightningbeam-editor/src/main.rs +++ b/lightningbeam-ui/lightningbeam-editor/src/main.rs @@ -751,6 +751,9 @@ impl EditorApp { fn new(cc: &eframe::CreationContext, layouts: Vec, theme: Theme) -> Self { let current_layout = layouts[0].layout.clone(); + // Disable egui's "Unaligned" debug overlay (on by default in debug builds) + cc.egui_ctx.style_mut(|style| style.debug.show_unaligned = false); + // Load application config let config = AppConfig::load(); diff --git a/lightningbeam-ui/lightningbeam-editor/src/panes/node_graph/mod.rs b/lightningbeam-ui/lightningbeam-editor/src/panes/node_graph/mod.rs index d31863d..88315e4 100644 --- a/lightningbeam-ui/lightningbeam-editor/src/panes/node_graph/mod.rs +++ b/lightningbeam-ui/lightningbeam-editor/src/panes/node_graph/mod.rs @@ -626,11 +626,15 @@ impl crate::panes::PaneRenderer for NodeGraphPane { // Allocate the rect and render the graph editor within it ui.allocate_ui_at_rect(rect, |ui| { // Check for scroll input to override library's default zoom behavior + // Only handle scroll when mouse is over the node graph area + let pointer_over_graph = ui.rect_contains_pointer(rect); let modifiers = ui.input(|i| i.modifiers); let has_ctrl = modifiers.ctrl || modifiers.command; // When ctrl is held, check for raw scroll events in the events list - let scroll_delta = if has_ctrl { + let scroll_delta = if !pointer_over_graph { + egui::Vec2::ZERO + } else if has_ctrl { // Sum up scroll events from the raw event list ui.input(|i| { let mut total_scroll = egui::Vec2::ZERO; diff --git a/lightningbeam-ui/lightningbeam-editor/src/panes/timeline.rs b/lightningbeam-ui/lightningbeam-editor/src/panes/timeline.rs index 5fe0852..ff45405 100644 --- a/lightningbeam-ui/lightningbeam-editor/src/panes/timeline.rs +++ b/lightningbeam-ui/lightningbeam-editor/src/panes/timeline.rs @@ -1759,8 +1759,10 @@ impl TimelinePane { } // Distinguish between mouse wheel (discrete) and trackpad (smooth) + // Only handle scroll when mouse is over the timeline area let mut handled = false; - ui.input(|i| { + let pointer_over_timeline = response.hovered() || ui.rect_contains_pointer(header_rect); + if pointer_over_timeline { ui.input(|i| { for event in &i.raw.events { if let egui::Event::MouseWheel { unit, delta, modifiers, .. } = event { match unit { @@ -1787,10 +1789,10 @@ impl TimelinePane { } } } - }); + }); } // Handle scroll_delta for trackpad panning (when Ctrl not held) - if !handled { + if pointer_over_timeline && !handled { let scroll_delta = ui.input(|i| i.smooth_scroll_delta); if scroll_delta.x.abs() > 0.0 || scroll_delta.y.abs() > 0.0 { // Horizontal scroll: pan timeline (inverted: positive delta scrolls left/earlier in time)