Ported: TileMapEditor Fix interrupted erasing not being properly finished - kleonc

66551a94be
This commit is contained in:
Relintai 2022-07-29 22:06:26 +02:00
parent 0d8a6b6cdd
commit c569ecfad1

View File

@ -36,11 +36,11 @@
#include "editor/editor_scale.h" #include "editor/editor_scale.h"
#include "editor/editor_settings.h" #include "editor/editor_settings.h"
#include "editor/plugins/canvas_item_editor_plugin.h" #include "editor/plugins/canvas_item_editor_plugin.h"
#include "scene/gui/split_container.h"
#include "scene/gui/slider.h"
#include "scene/gui/popup_menu.h"
#include "scene/gui/item_list.h" #include "scene/gui/item_list.h"
#include "scene/gui/popup_menu.h"
#include "scene/gui/separator.h" #include "scene/gui/separator.h"
#include "scene/gui/slider.h"
#include "scene/gui/split_container.h"
void RTileMapEditor::_node_removed(Node *p_node) { void RTileMapEditor::_node_removed(Node *p_node) {
if (p_node == node) { if (p_node == node) {
@ -1028,6 +1028,17 @@ bool RTileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
return false; // Drag. 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 (tool == TOOL_NONE) {
if (mb->get_shift()) { if (mb->get_shift()) {
if (mb->get_command()) { if (mb->get_command()) {