Prevent to select children if selection lock or instanced scene
Fix #7086
(cherry picked from commit c3f4d676c0
)
This commit is contained in:
parent
9219ac7e44
commit
2d6dabc68e
1 changed files with 14 additions and 7 deletions
|
@ -522,6 +522,13 @@ void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2& p_rect,Node* p_no
|
|||
CanvasItem *c=p_node->cast_to<CanvasItem>();
|
||||
|
||||
|
||||
bool inherited=p_node!=get_tree()->get_edited_scene_root() && p_node->get_filename()!="";
|
||||
bool editable=false;
|
||||
if (inherited){
|
||||
editable=EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(p_node);
|
||||
}
|
||||
bool lock_children=p_node->has_meta("_edit_group_") && p_node->get_meta("_edit_group_");
|
||||
if (!lock_children && (!inherited || editable)) {
|
||||
for (int i=p_node->get_child_count()-1;i>=0;i--) {
|
||||
|
||||
if (c && !c->is_set_as_toplevel())
|
||||
|
@ -531,7 +538,7 @@ void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2& p_rect,Node* p_no
|
|||
_find_canvas_items_at_rect(p_rect,p_node->get_child(i),transform,cl?cl->get_transform():p_canvas_xform,r_items);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (c && c->is_visible() && !c->has_meta("_edit_lock_") && !c->cast_to<CanvasLayer>()) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue