1
0
forked from noxious/client

Added min and max to zoom

This commit is contained in:
Colin Kallemein 2024-09-28 20:14:46 +02:00
parent 31ce0a8264
commit 3c5ceaae2d

View File

@ -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)
}