[Bf-blender-cvs] [e2febd81680] soc-2020-outliner: Outliner: Fix dragdrop insert not working for childless elements

Nathan Craddock noreply at git.blender.org
Sat Jul 25 22:03:51 CEST 2020


Commit: e2febd81680ff2add1fe5fe1ed88f5a29dedc6dc
Author: Nathan Craddock
Date:   Fri Jul 24 16:44:04 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rBe2febd81680ff2add1fe5fe1ed88f5a29dedc6dc

Outliner: Fix dragdrop insert not working for childless elements

Childless elements are flagged as open, so sorting after does not work.
An additional check to see if there are any children is neded.

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c
index d71a6ea1b39..ca19bcd2b2b 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -186,7 +186,8 @@ static TreeElement *outliner_drop_insert_find(bContext *C,
     const float margin = UI_UNIT_Y * (1.0f / 4);
 
     if (view_mval[1] < (te_hovered->ys + margin)) {
-      if (TSELEM_OPEN(TREESTORE(te_hovered), soops)) {
+      if (TSELEM_OPEN(TREESTORE(te_hovered), soops) &&
+          !BLI_listbase_is_empty(&te_hovered->subtree)) {
         /* inserting after a open item means we insert into it, but as first child */
         if (BLI_listbase_is_empty(&te_hovered->subtree)) {
           *r_insert_type = TE_INSERT_INTO;



More information about the Bf-blender-cvs mailing list