forked from noxious/client
Put zoom calculation in variable
This commit is contained in:
parent
3c5ceaae2d
commit
3dbd68d5cf
@ -56,8 +56,9 @@ export function useGamePointerHandlers(scene: Phaser.Scene, layer: Phaser.Tilema
|
||||
if (!(pointer.event instanceof WheelEvent) || !pointer.event.shiftKey) return
|
||||
|
||||
const deltaY = pointer.event.deltaY
|
||||
if((scene.scale.zoom - deltaY * 0.005) <= 0 || (scene.scale.zoom - deltaY * 0.005) >= 3) return
|
||||
scene.scale.setZoom(scene.scale.zoom - deltaY * 0.005)
|
||||
let zoomLevel = scene.scale.zoom - deltaY * 0.005
|
||||
if(zoomLevel <= 0 || zoomLevel >= 3) return
|
||||
scene.scale.setZoom(zoomLevel)
|
||||
}
|
||||
|
||||
const setupPointerHandlers = () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user