diff --git a/src/Tools/DesignTools/CurveTool.gd b/src/Tools/DesignTools/CurveTool.gd index 7e76adade..999c2b16e 100644 --- a/src/Tools/DesignTools/CurveTool.gd +++ b/src/Tools/DesignTools/CurveTool.gd @@ -10,7 +10,8 @@ var _last_mouse_position := Vector2.INF ## The last position of the mouse func _init() -> void: - Global.project_about_to_switch.connect(_clear) # To prevent tool from remaining active + # To prevent tool from remaining active when switching projects + Global.project_about_to_switch.connect(_clear) _drawer.color_op = Drawer.ColorOp.new() update_indicator() @@ -182,6 +183,7 @@ func _clear() -> void: _curve.clear_points() _drawing = false _editing_out_control_point = false + Global.canvas.previews.queue_redraw() ## Get the [member _curve]'s baked points, and draw lines between them using [method _fill_gap]. diff --git a/src/Tools/SelectionTools/PolygonSelect.gd b/src/Tools/SelectionTools/PolygonSelect.gd index 82a5a1b26..b9c31e099 100644 --- a/src/Tools/SelectionTools/PolygonSelect.gd +++ b/src/Tools/SelectionTools/PolygonSelect.gd @@ -5,6 +5,11 @@ var _draw_points: Array[Vector2i] = [] var _ready_to_apply := false +func _init() -> void: + # To prevent tool from remaining active when switching projects + Global.project_about_to_switch.connect(_clear) + + func _input(event: InputEvent) -> void: if _move: return @@ -20,10 +25,7 @@ func _input(event: InputEvent) -> void: apply_selection(Vector2i.ZERO) # Argument doesn't matter else: if event.is_action_pressed("transformation_cancel") and _ongoing_selection: - _ongoing_selection = false - _draw_points.clear() - _ready_to_apply = false - Global.canvas.previews.queue_redraw() + _clear() func draw_start(pos: Vector2i) -> void: @@ -139,6 +141,10 @@ func apply_selection(pos: Vector2i) -> void: Global.canvas.selection.clear_selection() Global.canvas.selection.commit_undo("Select", undo_data) + _clear() + + +func _clear() -> void: _ongoing_selection = false _draw_points.clear() _ready_to_apply = false