Merge pull request #63167 from kleonc/tilemap-interrupted-erasing-crash-fix

This commit is contained in:
Rémi Verschelde 2022-07-19 12:09:48 +02:00 committed by GitHub
commit d4e261b2d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -1171,6 +1171,17 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &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()) {