mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 01:29:49 +00:00
Merge pull request #95 from Calinou/no-update-on-key-input
Don't call `update()` in the canvas on non-mouse input events
This commit is contained in:
commit
88fa8c5e47
|
@ -80,8 +80,12 @@ func camera_zoom() -> void:
|
||||||
Global.camera2.offset = size / 2
|
Global.camera2.offset = size / 2
|
||||||
Global.camera_preview.offset = size / 2
|
Global.camera_preview.offset = size / 2
|
||||||
|
|
||||||
# warning-ignore:unused_argument
|
func _input(event : InputEvent) -> void:
|
||||||
func _input(event) -> 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
|
sprite_changed_this_frame = false
|
||||||
if Global.current_frame == frame:
|
if Global.current_frame == frame:
|
||||||
update()
|
update()
|
||||||
|
|
Loading…
Reference in a new issue