[Bf-blender-cvs] [d3c083f5bee] soc-2019-outliner: Outliner: Cleanup outliner_select.c
Nathan Craddock
noreply at git.blender.org
Fri Jul 26 04:40:01 CEST 2019
Commit: d3c083f5bee7d0977d8b6e945dc92810ec36d9ca
Author: Nathan Craddock
Date: Thu Jul 25 15:36:08 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBd3c083f5bee7d0977d8b6e945dc92810ec36d9ca
Outliner: Cleanup outliner_select.c
Remove the unnecessary toggle function which involved duplicated
code, and move the check for restrict columns to the utils file
as it is used in multiple files.
===================================================================
M source/blender/editors/space_outliner/outliner_select.c
M source/blender/editors/space_outliner/outliner_utils.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 09b62261c90..6e74eab160f 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1331,25 +1331,6 @@ static void do_outliner_range_select(SpaceOutliner *soops, TreeElement *cursor)
do_outliner_range_select_recursive(&soops->tree, active, cursor, &selecting);
}
-static void outliner_item_toggle_closed(TreeElement *te, const bool toggle_children)
-{
- TreeStoreElem *tselem = TREESTORE(te);
- if (toggle_children) {
- tselem->flag &= ~TSE_CLOSED;
-
- const bool all_opened = !outliner_flag_is_any_test(&te->subtree, TSE_CLOSED, 1);
- outliner_flag_set(&te->subtree, TSE_CLOSED, all_opened);
- }
- else {
- tselem->flag ^= TSE_CLOSED;
- }
-}
-
-bool outliner_item_is_co_within_close_toggle(TreeElement *te, float view_co_x)
-{
- return (view_co_x > te->xs) && (view_co_x < te->xs + UI_UNIT_X);
-}
-
static bool outliner_is_co_within_restrict_columns(const SpaceOutliner *soops,
const ARegion *ar,
float view_co_x)
diff --git a/source/blender/editors/space_outliner/outliner_utils.c b/source/blender/editors/space_outliner/outliner_utils.c
index 146a9f02f51..428a0f0f6dd 100644
--- a/source/blender/editors/space_outliner/outliner_utils.c
+++ b/source/blender/editors/space_outliner/outliner_utils.c
@@ -356,3 +356,9 @@ bool outliner_is_element_visible(const TreeElement *te)
return true;
}
+
+/* Find if x coordinate is over element disclosure toggle */
+bool outliner_item_is_co_within_close_toggle(TreeElement *te, float view_co_x)
+{
+ return (view_co_x > te->xs) && (view_co_x < te->xs + UI_UNIT_X);
+}
\ No newline at end of file
More information about the Bf-blender-cvs
mailing list