Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Commit

Permalink
Improve the wheel velocity (workadventure#3749)
Browse files Browse the repository at this point in the history
  • Loading branch information
gparant authored Feb 28, 2024
1 parent 6e7b9be commit 20b54d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions play/src/front/Phaser/Services/WaScaleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 20b54d1

Please sign in to comment.