mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-05 19:04:48 -04:00
Fix bug with undo and drawing after motion draw, again
If you did motion drawing, stopped and then went to draw to the frame the motion drawing started, undo wouldn't work properly. That's because can_undo was false.
This commit is contained in:
parent
f9bcab78f9
commit
d1793c2e60
1 changed files with 3 additions and 1 deletions
|
@ -184,6 +184,7 @@ func _input(event : InputEvent) -> void:
|
|||
made_line = false
|
||||
mouse_press_pixels.clear()
|
||||
mouse_press_pressure_values.clear()
|
||||
can_undo = true
|
||||
|
||||
current_pixel = get_local_mouse_position() + location
|
||||
if Global.current_frame != frame:
|
||||
|
@ -288,7 +289,6 @@ func _input(event : InputEvent) -> void:
|
|||
if can_handle || Global.undos == Global.undo_redo.get_version():
|
||||
if previous_action != "None" && previous_action != "RectSelect" && current_action != "ColorPicker":
|
||||
handle_redo("Draw")
|
||||
can_undo = true
|
||||
|
||||
match current_action: # Handle current tool
|
||||
"Pencil":
|
||||
|
@ -475,6 +475,8 @@ func handle_undo(action : String) -> void:
|
|||
can_undo = false
|
||||
|
||||
func handle_redo(action : String) -> void:
|
||||
can_undo = true
|
||||
|
||||
if Global.undos < Global.undo_redo.get_version():
|
||||
return
|
||||
var canvases := []
|
||||
|
|
Loading…
Add table
Reference in a new issue