From 20b54d1af2d114f484fd6bfb66f908b0ffeb7c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?gr=C3=A9goire=20parant?= Date: Wed, 28 Feb 2024 08:40:56 +0100 Subject: [PATCH] Improve the wheel velocity (#3749) --- play/src/front/Phaser/Services/WaScaleManager.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/play/src/front/Phaser/Services/WaScaleManager.ts b/play/src/front/Phaser/Services/WaScaleManager.ts index af9683b74d..a83bdd768b 100644 --- a/play/src/front/Phaser/Services/WaScaleManager.ts +++ b/play/src/front/Phaser/Services/WaScaleManager.ts @@ -129,10 +129,10 @@ export class WaScaleManager { } public handleZoomByFactor(zoomFactor: number, camera: Phaser.Cameras.Scene2D.Camera): void { - if (zoomFactor > 1 && this.zoomModifier * zoomFactor - this.zoomModifier > 0.02) - this.setZoomModifier(this.zoomModifier * 1.02, camera); - else if (zoomFactor < 1 && this.zoomModifier - this.zoomModifier * zoomFactor > 0.02) - this.setZoomModifier(this.zoomModifier * 0.98, camera); + if (zoomFactor > 1 && this.zoomModifier * zoomFactor - this.zoomModifier > 0.1) + this.setZoomModifier(this.zoomModifier * 1.1, camera); + else if (zoomFactor < 1 && this.zoomModifier - this.zoomModifier * zoomFactor > 0.1) + this.setZoomModifier(this.zoomModifier * 0.9, camera); else this.setZoomModifier(this.zoomModifier * zoomFactor, camera); if (this.focusTarget) {