summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorLlamaLad7 <l3gomindstorms@gmail.com>2021-11-24 20:31:21 +0000
committerLlamaLad7 <l3gomindstorms@gmail.com>2021-12-21 21:41:05 +0000
commitb5407f802fbcd3cf78a62075cb5a4af5f173fa08 (patch)
tree7167dc5bf35aa36f5423fe037512789c8b2e60a2 /editor
parent489f11ee0cbbb90f4f629aa7fd846078148aaa8e (diff)
Editor: Resolve being able to move control nodes in containers using arrow keys
Fixes #55260
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 4a19e7752e..1c4449a314 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2097,8 +2097,16 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) {
if (k.is_valid() && k->is_pressed() && (tool == TOOL_SELECT || tool == TOOL_MOVE) &&
(k->get_keycode() == Key::UP || k->get_keycode() == Key::DOWN || k->get_keycode() == Key::LEFT || k->get_keycode() == Key::RIGHT)) {
if (!k->is_echo()) {
- // Start moving the canvas items with the keyboard
- drag_selection = _get_edited_canvas_items();
+ // Start moving the canvas items with the keyboard, if they are movable
+ List<CanvasItem *> selection = _get_edited_canvas_items();
+
+ drag_selection.clear();
+ for (CanvasItem *item : selection) {
+ if (_is_node_movable(item, true)) {
+ drag_selection.push_back(item);
+ }
+ }
+
drag_type = DRAG_KEY_MOVE;
drag_from = Vector2();
drag_to = Vector2();