Skip to content

Commit

Permalink
[RPP] Fix Zoom on Cmd/Ctrl bug
Browse files Browse the repository at this point in the history
On Mac, the 'modern' navigation zoom should happen on Cmd + scroll. There was a bug that made it only zoom on Ctrl + scrool

Bug: None
Change-Id: I1db4b861c830cc82eb3cf133050735e9fc12f831
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6140553
Reviewed-by: Nancy Li <[email protected]>
Auto-Submit: Alina Varkki <[email protected]>
Commit-Queue: Alina Varkki <[email protected]>
  • Loading branch information
AlinaVarkki authored and Devtools-frontend LUCI CQ committed Jan 3, 2025
1 parent 2636063 commit ef61624
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion front_end/ui/legacy/components/perf_ui/ChartViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,10 @@ export class ChartViewport extends UI.Widget.VBox {
this.handleZoomGesture(zoomDelta);
}
} else if (navigation === 'modern') {
const isCtrlOrCmd = UI.KeyboardShortcut.KeyboardShortcut.eventHasCtrlEquivalentKey(wheelEvent);
if (wheelEvent.shiftKey) { // Pan left/right
this.handlePanGesture(wheelEvent.deltaY, /* animate */ true);
} else if (wheelEvent.ctrlKey || Math.abs(wheelEvent.deltaX) > Math.abs(wheelEvent.deltaY)) { // Zoom
} else if (isCtrlOrCmd || Math.abs(wheelEvent.deltaX) > Math.abs(wheelEvent.deltaY)) { // Zoom
this.handleZoomGesture(zoomDelta);
} else { // Scroll
this.vScrollElement.scrollTop += scrollDelta;
Expand Down

0 comments on commit ef61624

Please sign in to comment.