handle edge case

no accessibilité
This commit is contained in:
Maeght Loan
2025-03-06 21:41:56 +00:00
parent 44de3516e8
commit e926fb5cd5
+8 -1
View File
@@ -200,6 +200,8 @@ export class InputHandler {
"Digit1",
"Digit2",
"KeyC",
"ControlLeft",
"ControlRight",
].includes(e.code)
) {
this.activeKeys.add(e.code);
@@ -250,6 +252,8 @@ export class InputHandler {
"Digit1",
"Digit2",
"KeyC",
"ControlLeft",
"ControlRight",
].includes(e.code)
) {
this.activeKeys.delete(e.code);
@@ -310,7 +314,10 @@ export class InputHandler {
private onScroll(event: WheelEvent) {
if (!event.shiftKey) {
const ratio = event.ctrlKey ? 10 : 1; // Compensate pinch-zoom low sensitivity
const realCtrl =
this.activeKeys.has("ControlLeft") ||
this.activeKeys.has("ControlRight");
const ratio = event.ctrlKey && !realCtrl ? 10 : 1; // Compensate pinch-zoom low sensitivity
this.eventBus.emit(new ZoomEvent(event.x, event.y, event.deltaY * ratio));
}
}