Merge pull request #44248 from Nickswoboda/fix-dragging-0-items

Fix scene being modified when arrows are pressed with no node selected
This commit is contained in:
Rémi Verschelde 2020-12-10 11:15:34 +01:00 committed by GitHub
commit d4d05783d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2356,12 +2356,12 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) {
(!Input::get_singleton()->is_key_pressed(KEY_DOWN)) &&
(!Input::get_singleton()->is_key_pressed(KEY_LEFT)) &&
(!Input::get_singleton()->is_key_pressed(KEY_RIGHT))) {
if (drag_selection.size() != 1) {
if (drag_selection.size() > 1) {
_commit_canvas_item_state(
drag_selection,
vformat(TTR("Move %d CanvasItems"), drag_selection.size()),
true);
} else {
} else if (drag_selection.size() == 1) {
_commit_canvas_item_state(
drag_selection,
vformat(TTR("Move CanvasItem \"%s\" to (%d, %d)"),