[Bf-blender-cvs] [7b7772e1809] soc-2019-outliner: Outliner: Fix range select sometimes leaving hidden elements selected

Nathan Craddock noreply at git.blender.org
Mon Jul 1 19:07:28 CEST 2019


Commit: 7b7772e18090ae10b7e1f3145a801081d8c4b37d
Author: Nathan Craddock
Date:   Mon Jul 1 11:05:56 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB7b7772e18090ae10b7e1f3145a801081d8c4b37d

Outliner: Fix range select sometimes leaving hidden elements selected

The range select opearator sometimes would leave other elements
selected when changing the active element. This is fixed by
clearing the selection each time the operator runs.

===================================================================

M	source/blender/editors/space_outliner/outliner_select.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index cbcd58b89a4..b87d517adf1 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1279,11 +1279,19 @@ static void do_outliner_range_select(SpaceOutliner *soops, TreeElement *cursor)
 {
   TreeElement *active = outliner_find_active_element(&soops->tree);
   TreeStoreElem *tselem = TREESTORE(active);
+  const bool active_selected = (tselem->flag & TSE_SELECTED);
 
-  /* Select element under cursor if active element not visible or if the cursor element is the
-   * active element */
-  if (!(tselem->flag & TSE_SELECTED) || !outliner_is_element_visible(active) ||
-      (active == cursor)) {
+  outliner_flag_set(&soops->tree, TSE_SELECTED, false);
+
+  /* Only select active if under cursor */
+  if (active == cursor) {
+    TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE;
+    return;
+  }
+
+  /* If active is not selected, just select the element under the cursor */
+  if (!active_selected || !outliner_is_element_visible(active)) {
+    tselem->flag &= ~TSE_ACTIVE;
     TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE;
     return;
   }



More information about the Bf-blender-cvs mailing list