Skip to content

Commit 6f3095b

Browse files
AlinaVarkkiDevtools-frontend LUCI CQ
authored andcommitted
[RPP] Fix faster zoom with shift
We have a logic for a 0.8 zoom instead of 0.3 when the zoom keys 's' and 'w' are clicked together with shift, but the zoom was never applied due to the zoom handling code prematurely exiting if any modifier keys were detected. The issue has been resolved by adding an exception for the 'shift' key, allowing the intended zoom behavior to function correctly. Bug: None Change-Id: I6f7ae5a1c30328b919a64c147d10b5bbff4e68ed Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5938662 Reviewed-by: Jack Franklin <[email protected]> Auto-Submit: Alina Varkki <[email protected]> Commit-Queue: Alina Varkki <[email protected]>
1 parent 5ace52b commit 6f3095b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,11 @@ export class ChartViewport extends UI.Widget.VBox {
393393
}
394394

395395
private handleZoomPanKeys(e: Event): void {
396-
if (!UI.KeyboardShortcut.KeyboardShortcut.hasNoModifiers(e)) {
396+
const keyboardEvent = (e as KeyboardEvent);
397+
// Do not zoom if the key combination has any modifiers other than shift key
398+
if (UI.KeyboardShortcut.KeyboardShortcut.hasAtLeastOneModifier(e) && !keyboardEvent.shiftKey) {
397399
return;
398400
}
399-
const keyboardEvent = (e as KeyboardEvent);
400401
const zoomFactor = keyboardEvent.shiftKey ? 0.8 : 0.3;
401402
const panOffset = keyboardEvent.shiftKey ? 320 : 160;
402403
switch (keyboardEvent.code) {

0 commit comments

Comments
 (0)