From af1893ba086ea12adcff2cb4ec48d29885e366bd Mon Sep 17 00:00:00 2001 From: Dimava Date: Sat, 4 Jul 2020 17:50:49 +0300 Subject: [PATCH] find a more meaningful name and make it const --- src/js/game/camera.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/game/camera.js b/src/js/game/camera.js index ab5c68eb..ab73fc83 100644 --- a/src/js/game/camera.js +++ b/src/js/game/camera.js @@ -514,10 +514,10 @@ export class Camera extends BasicSerializableObject { const mousePosition = this.root.app.mousePosition; if (mousePosition) { const worldPos = this.root.camera.screenToWorld(mousePosition); - let de = worldPos.sub(this.center); - this.desiredCenter = null; + const worldDelta = worldPos.sub(this.center); const actualDelta = this.zoomLevel / prevZoom - 1; - this.center = this.center.add(de.multiplyScalar(actualDelta)); + this.center = this.center.add(worldDelta.multiplyScalar(actualDelta)); + this.desiredCenter = null; } return false;