Skip to content

Commit

Permalink
Deselect all strokes if changing from SelectionTool
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemro committed Jun 16, 2022
1 parent 2b545d7 commit e5fa024
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lorien/InfiniteCanvas/InfiniteCanvas.gd
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ func center_to_mouse() -> void:
# -------------------------------------------------------------------------------------------------
func use_tool(tool_type: int) -> void:
_active_tool.enabled = false
_selection_tool.deselect_all_strokes()
var prev_tool := _active_tool

match tool_type:
Types.Tool.BRUSH:
_active_tool = _brush_tool
Expand All @@ -97,6 +96,12 @@ func use_tool(tool_type: int) -> void:
if prev_tool != _active_tool:
prev_tool.performing_stroke = false
end_stroke()
if prev_tool == _selection_tool:
_selection_tool._state = 0
_selection_tool._selection_rectangle.reset()
_selection_tool._selection_rectangle.update()
_selection_tool._commit_strokes_under_selection_rectangle()
_selection_tool.deselect_all_strokes()
_active_tool.enabled = true
_active_tool.get_cursor()._on_zoom_changed(_camera.zoom.x)

Expand Down

0 comments on commit e5fa024

Please sign in to comment.