Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-10-15 21:23:13 +0300
committerJulian Eisel <julian@blender.org>2020-10-15 21:31:36 +0300
commitd4f94d8a31044af489d4821966854a7bc8975d23 (patch)
treea4531b783c122238f983936b6175d149f5cbc48c /source/blender/editors/space_outliner/outliner_utils.c
parent5129e2e042a057a28ea75e4342a664277c74ca34 (diff)
Cleanup: Refactor lookup for hovered Outliner element for renaming
* Use existing and optimized lookup function, rather than own duplicated logic. * Move low-level coordinate check into general function, alongside similar ones.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_utils.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_utils.c b/source/blender/editors/space_outliner/outliner_utils.c
index 907b9d372af..c1551b5c584 100644
--- a/source/blender/editors/space_outliner/outliner_utils.c
+++ b/source/blender/editors/space_outliner/outliner_utils.c
@@ -429,6 +429,12 @@ bool outliner_item_is_co_over_name_icons(const TreeElement *te, float view_co_x)
return outside_left && (view_co_x < te->xend);
}
+/* Find if x coordinate is over element name. */
+bool outliner_item_is_co_over_name(const TreeElement *te, float view_co_x)
+{
+ return (view_co_x > (te->xs + UI_UNIT_X * 2)) && (view_co_x < te->xend);
+}
+
/* Find if x coordinate is over element disclosure toggle */
bool outliner_item_is_co_within_close_toggle(const TreeElement *te, float view_co_x)
{