mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
find a more meaningful name and make it const
This commit is contained in:
parent
35f427da82
commit
af1893ba08
@ -514,10 +514,10 @@ export class Camera extends BasicSerializableObject {
|
|||||||
const mousePosition = this.root.app.mousePosition;
|
const mousePosition = this.root.app.mousePosition;
|
||||||
if (mousePosition) {
|
if (mousePosition) {
|
||||||
const worldPos = this.root.camera.screenToWorld(mousePosition);
|
const worldPos = this.root.camera.screenToWorld(mousePosition);
|
||||||
let de = worldPos.sub(this.center);
|
const worldDelta = worldPos.sub(this.center);
|
||||||
this.desiredCenter = null;
|
|
||||||
const actualDelta = this.zoomLevel / prevZoom - 1;
|
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;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user