Fix moving 2D node with mouse after using arrow keys

Fixes: #38894
(cherry picked from commit 03b54f8a35)
This commit is contained in:
Dominik 'dreamsComeTrue' Jasiński 2020-05-21 14:50:35 +02:00 committed by Rémi Verschelde
parent ad3d643bc2
commit cf311f3e79
1 changed files with 1 additions and 1 deletions

View File

@ -2165,7 +2165,7 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) {
return true; return true;
} }
if (k.is_valid() && !k->is_pressed() && drag_type == DRAG_KEY_MOVE && tool == TOOL_SELECT && if (k.is_valid() && !k->is_pressed() && drag_type == DRAG_KEY_MOVE && (tool == TOOL_SELECT || tool == TOOL_MOVE) &&
(k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_LEFT || k->get_scancode() == KEY_RIGHT)) { (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_LEFT || k->get_scancode() == KEY_RIGHT)) {
// Confirm canvas items move by arrow keys // Confirm canvas items move by arrow keys
if ((!Input::get_singleton()->is_key_pressed(KEY_UP)) && if ((!Input::get_singleton()->is_key_pressed(KEY_UP)) &&