Skip to content

Commit ef61624

Browse files
AlinaVarkkiDevtools-frontend LUCI CQ
authored andcommitted
[RPP] Fix Zoom on Cmd/Ctrl bug
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]>
1 parent 2636063 commit ef61624

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

front_end/ui/legacy/components/perf_ui/ChartViewport.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,10 @@ export class ChartViewport extends UI.Widget.VBox {
232232
this.handleZoomGesture(zoomDelta);
233233
}
234234
} else if (navigation === 'modern') {
235+
const isCtrlOrCmd = UI.KeyboardShortcut.KeyboardShortcut.eventHasCtrlEquivalentKey(wheelEvent);
235236
if (wheelEvent.shiftKey) { // Pan left/right
236237
this.handlePanGesture(wheelEvent.deltaY, /* animate */ true);
237-
} else if (wheelEvent.ctrlKey || Math.abs(wheelEvent.deltaX) > Math.abs(wheelEvent.deltaY)) { // Zoom
238+
} else if (isCtrlOrCmd || Math.abs(wheelEvent.deltaX) > Math.abs(wheelEvent.deltaY)) { // Zoom
238239
this.handleZoomGesture(zoomDelta);
239240
} else { // Scroll
240241
this.vScrollElement.scrollTop += scrollDelta;

0 commit comments

Comments
 (0)