diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-01-10 12:09:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-10 12:09:24 +0100 |
commit | ebfd78ad7f1d40e0f5be36358a6464d43fd48d40 (patch) | |
tree | a82891839e0188f4c857dc7276dc9fc1f61be377 | |
parent | f7d2750844546f5d8a2b664c132890f7ed466b35 (diff) | |
parent | c48f92e394220b992648eeb8d871ed290786d286 (diff) |
Merge pull request #24871 from groud/fix_bones_selection
Fixes 2D bones selection
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index ea6c83f49c..b0e812a130 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2033,16 +2033,19 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) { // Find the item to select CanvasItem *canvas_item = NULL; - Vector<_SelectResult> selection; - - // Retrieve the items - _get_canvas_items_at_pos(click, selection); // Retrieve the bones + Vector<_SelectResult> selection = Vector<_SelectResult>(); _get_bones_at_pos(click, selection); - if (!selection.empty()) { canvas_item = selection[0].item; + } else { + // Retrieve the canvas items + selection = Vector<_SelectResult>(); + _get_canvas_items_at_pos(click, selection); + if (!selection.empty()) { + canvas_item = selection[0].item; + } } if (!canvas_item) { |