forked from noxious/client
Added min and max to zoom
This commit is contained in:
parent
31ce0a8264
commit
3c5ceaae2d
@ -56,6 +56,7 @@ 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)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user