diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-11-26 23:30:31 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-11-27 06:37:21 +0300 |
commit | ab4654cdfe8f393d70426456a29c3ae0bfc4ac03 (patch) | |
tree | 4ffccc5a2e770c70a7c8ce6b607f61ccb218319d /source/blender/editors/space_outliner/outliner_utils.c | |
parent | 1709bc51643d57278063562389519705f331a2c0 (diff) |
Cleanup: Move logic to `outliner_find_item_at_x_in_row`
Move the logic for determining if the item at a given x position is an
icon into the function. This is used for determining selection over an
icon, and will be used in a later commit for checking for hover over an
icon. No functional changes.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_utils.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_utils.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/editors/space_outliner/outliner_utils.c b/source/blender/editors/space_outliner/outliner_utils.c index 79f696e1511..f3f2c93e7a0 100644 --- a/source/blender/editors/space_outliner/outliner_utils.c +++ b/source/blender/editors/space_outliner/outliner_utils.c @@ -150,16 +150,22 @@ static TreeElement *outliner_find_item_at_x_in_row_recursive(const TreeElement * * \return a hovered child item or \a parent_te (if no hovered child found). */ TreeElement *outliner_find_item_at_x_in_row(const SpaceOutliner *space_outliner, - const TreeElement *parent_te, + TreeElement *parent_te, float view_co_x, - bool *row_merged) + bool *row_merged, + bool *r_is_over_icon) { /* if parent_te is opened, it doesn't show children in row */ + TreeElement *te = parent_te; if (!TSELEM_OPEN(TREESTORE(parent_te), space_outliner)) { - return outliner_find_item_at_x_in_row_recursive(parent_te, view_co_x, row_merged); + te = outliner_find_item_at_x_in_row_recursive(parent_te, view_co_x, row_merged); } - return (TreeElement *)parent_te; + if ((te != parent_te) || outliner_item_is_co_over_icon(parent_te, view_co_x)) { + *r_is_over_icon = true; + } + + return te; } /* Find specific item from the treestore */ |