From 66551a94be155207dbadc4172e97fba439924790 Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Mon, 18 Jul 2022 22:29:50 +0200 Subject: [PATCH] `TileMapEditor` Fix interrupted erasing not being properly finished --- editor/plugins/tile_map_editor_plugin.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index c566afedc5a..9eeac1b8994 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -1171,6 +1171,17 @@ bool TileMapEditor::forward_gui_input(const Ref &p_event) { return false; // Drag. } + // Finish ongoing erasing. + if (tool == TOOL_ERASING || tool == TOOL_RECTANGLE_ERASE || tool == TOOL_LINE_ERASE) { + _finish_undo(); + + if (tool == TOOL_RECTANGLE_ERASE || tool == TOOL_LINE_ERASE) { + CanvasItemEditor::get_singleton()->update_viewport(); + } + + tool = TOOL_NONE; + } + if (tool == TOOL_NONE) { if (mb->get_shift()) { if (mb->get_command()) {