1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Don't call update() in the canvas on non-mouse input events

This partially addresses #85.
This commit is contained in:
Hugo Locurcio 2019-12-27 16:12:19 +01:00
parent e06586edce
commit 02c76cfd14
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C

View file

@ -80,8 +80,12 @@ func camera_zoom() -> void:
Global.camera2.offset = size / 2
Global.camera_preview.offset = size / 2
# warning-ignore:unused_argument
func _input(event) -> void:
func _input(event : InputEvent) -> void:
# Don't process anything below if the input isn't a mouse event.
# This decreases CPU/GPU usage slightly.
if not event is InputEventMouse:
return
sprite_changed_this_frame = false
if Global.current_frame == frame:
update()