From 0ef3c0fedf94fc8ede3f3616e5cb20d9a1f9ad66 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:23:56 -0400 Subject: [PATCH] Fix Ctrl+scroll-down not zooming out (#83) PointerWheelChanged was attached with bubble routing, so the ScrollViewer consumed scroll-down events before the Ctrl+zoom handler could intercept them. Switch to Tunnel routing via AddHandler so the zoom handler fires first, matching how the pan handlers are already wired up. Closes #83 Co-Authored-By: Claude Opus 4.6 --- src/PlanViewer.App/Controls/PlanViewerControl.axaml.cs | 3 ++- src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/PlanViewer.App/Controls/PlanViewerControl.axaml.cs b/src/PlanViewer.App/Controls/PlanViewerControl.axaml.cs index 3ef8327..60045d0 100644 --- a/src/PlanViewer.App/Controls/PlanViewerControl.axaml.cs +++ b/src/PlanViewer.App/Controls/PlanViewerControl.axaml.cs @@ -118,7 +118,8 @@ public partial class PlanViewerControl : UserControl public PlanViewerControl() { InitializeComponent(); - PlanScrollViewer.PointerWheelChanged += PlanScrollViewer_PointerWheelChanged; + // Use Tunnel routing so Ctrl+wheel zoom fires before ScrollViewer consumes the event + PlanScrollViewer.AddHandler(PointerWheelChangedEvent, PlanScrollViewer_PointerWheelChanged, Avalonia.Interactivity.RoutingStrategies.Tunnel); // Use Tunnel routing so pan handlers fire before ScrollViewer consumes the events PlanScrollViewer.AddHandler(PointerPressedEvent, PlanScrollViewer_PointerPressed, Avalonia.Interactivity.RoutingStrategies.Tunnel); PlanScrollViewer.AddHandler(PointerMovedEvent, PlanScrollViewer_PointerMoved, Avalonia.Interactivity.RoutingStrategies.Tunnel); diff --git a/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs b/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs index fadeed6..ffda5b6 100644 --- a/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs +++ b/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs @@ -60,8 +60,8 @@ public QuerySessionControl(ICredentialService credentialService, ConnectionStore // Keybindings: F5/Ctrl+E for Execute, Ctrl+L for Estimated Plan KeyDown += OnKeyDown; - // Ctrl+mousewheel for font zoom - QueryEditor.PointerWheelChanged += OnEditorPointerWheel; + // Ctrl+mousewheel for font zoom — use Tunnel so it fires before ScrollViewer consumes scroll-down + QueryEditor.AddHandler(Avalonia.Input.InputElement.PointerWheelChangedEvent, OnEditorPointerWheel, Avalonia.Interactivity.RoutingStrategies.Tunnel); // Code completion QueryEditor.TextArea.TextEntering += OnTextEntering;