Editor: Resolve being able to move control nodes in containers using arrow keys
Fixes #55260
This commit is contained in:
parent
489f11ee0c
commit
b5407f802f
@ -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) &&
|
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)) {
|
(k->get_keycode() == Key::UP || k->get_keycode() == Key::DOWN || k->get_keycode() == Key::LEFT || k->get_keycode() == Key::RIGHT)) {
|
||||||
if (!k->is_echo()) {
|
if (!k->is_echo()) {
|
||||||
// Start moving the canvas items with the keyboard
|
// Start moving the canvas items with the keyboard, if they are movable
|
||||||
drag_selection = _get_edited_canvas_items();
|
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_type = DRAG_KEY_MOVE;
|
||||||
drag_from = Vector2();
|
drag_from = Vector2();
|
||||||
drag_to = Vector2();
|
drag_to = Vector2();
|
||||||
|
Loading…
Reference in New Issue
Block a user