Fix Outliner: Click next to View Layer name triggers object select

Unlike other (closed) hierarchies, view layers dont show their contents
next to their names.

Code would still find the item via outliner_find_item_at_x_in_row though,
this is now prevented (same as if the viewlayer was open [instead of
collapsed]).

Fixes T102357.

Maniphest Tasks: T102357

Differential Revision: https://developer.blender.org/D16662
This commit is contained in:
Philipp Oeser 2022-12-01 11:41:26 +01:00 committed by Philipp Oeser
parent 158752cee6
commit 442ce8610d
Notes: blender-bot 2023-02-14 05:41:57 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #102357, Outliner: Click on empty area next to View Layer name triggers object select
1 changed files with 4 additions and 2 deletions

View File

@ -132,9 +132,11 @@ TreeElement *outliner_find_item_at_x_in_row(const SpaceOutliner *space_outliner,
bool *r_is_merged_icon,
bool *r_is_over_icon)
{
/* if parent_te is opened, it doesn't show children in row */
TreeStoreElem *parent_tselem = TREESTORE(parent_te);
TreeElement *te = parent_te;
if (!TSELEM_OPEN(TREESTORE(parent_te), space_outliner)) {
/* If parent_te is opened, or it is a ViewLayer, it doesn't show children in row. */
if (!TSELEM_OPEN(parent_tselem, space_outliner) && parent_tselem->type != TSE_R_LAYER) {
te = outliner_find_item_at_x_in_row_recursive(parent_te, view_co_x, r_is_merged_icon);
}