mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 01:29:49 +00:00
Allow moving the canvas through panning and zooming through a zooming gesture (#391)
This commit is contained in:
parent
5c200bf290
commit
e0b010867a
|
@ -126,6 +126,13 @@ func _input(event : InputEvent) -> void:
|
||||||
zoom_camera(-1)
|
zoom_camera(-1)
|
||||||
elif event.is_action_pressed("zoom_out"): # Wheel Down Event
|
elif event.is_action_pressed("zoom_out"): # Wheel Down Event
|
||||||
zoom_camera(1)
|
zoom_camera(1)
|
||||||
|
elif event is InputEventMagnifyGesture: # Zoom Gesture on a Laptop touchpad
|
||||||
|
if event.factor < 1:
|
||||||
|
zoom_camera(1)
|
||||||
|
else:
|
||||||
|
zoom_camera(-1)
|
||||||
|
elif event is InputEventPanGesture: # Pan Gesture on a Latop touchpad
|
||||||
|
offset = offset + event.delta * zoom * 7 # for moving the canvas
|
||||||
elif event is InputEventMouseMotion && drag:
|
elif event is InputEventMouseMotion && drag:
|
||||||
offset = offset - event.relative * zoom
|
offset = offset - event.relative * zoom
|
||||||
update_transparent_checker_offset()
|
update_transparent_checker_offset()
|
||||||
|
|
Loading…
Reference in a new issue