1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +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:
Overloaded 2019-12-27 17:18:25 +02:00 committed by GitHub
commit 88fa8c5e47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()