1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-30 23:19:49 +00:00

Restore freehand drawing on motion drawing

This commit is contained in:
OverloadedOrama 2020-01-16 01:38:44 +02:00
parent e1512bc5a6
commit 808883b3a5

View file

@ -100,8 +100,6 @@ func camera_zoom() -> void:
Global.camera_preview.offset = size / 2 Global.camera_preview.offset = size / 2
func _input(event : InputEvent) -> void: func _input(event : InputEvent) -> void:
if Global.current_frame != frame:
return
# Don't process anything below if the input isn't a mouse event, or Shift/Ctrl. # Don't process anything below if the input isn't a mouse event, or Shift/Ctrl.
# This decreases CPU/GPU usage slightly. # This decreases CPU/GPU usage slightly.
if not event is InputEventMouse: if not event is InputEventMouse:
@ -112,6 +110,12 @@ func _input(event : InputEvent) -> void:
return return
current_pixel = get_local_mouse_position() + location current_pixel = get_local_mouse_position() + location
if Global.current_frame != frame:
previous_mouse_pos = current_pixel
previous_mouse_pos.x = clamp(previous_mouse_pos.x, location.x, location.x + size.x)
previous_mouse_pos.y = clamp(previous_mouse_pos.y, location.y, location.y + size.y)
return
if Global.has_focus: if Global.has_focus:
update() update()