[Bf-blender-cvs] [08cde7c785e] blender2.8: Fix incorrect positioning of collection when dropping it after expanded one
Julian Eisel
noreply at git.blender.org
Fri Mar 10 15:59:53 CET 2017
Commit: 08cde7c785e38f44af2e3c2584e1f88a31c38782
Author: Julian Eisel
Date: Fri Mar 10 15:56:41 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB08cde7c785e38f44af2e3c2584e1f88a31c38782
Fix incorrect positioning of collection when dropping it after expanded one
===================================================================
M source/blender/editors/space_outliner/outliner_ops.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c
index 6fc088e0f48..4fc912f85c7 100644
--- a/source/blender/editors/space_outliner/outliner_ops.c
+++ b/source/blender/editors/space_outliner/outliner_ops.c
@@ -30,6 +30,7 @@
#include "BKE_context.h"
+#include "BLI_listbase.h"
#include "BLI_math.h"
#include "ED_screen.h"
@@ -91,7 +92,19 @@ static void outliner_item_drag_handle(
te_dragged->drag_data->insert_handle = insert_handle;
if (view_mval[1] < (insert_handle->ys + margin)) {
- te_dragged->drag_data->insert_type = TE_INSERT_AFTER;
+ if (TSELEM_OPEN(tselem_handle, soops)) {
+ /* inserting after a open item means we insert into it, but as first child */
+ if (BLI_listbase_is_empty(&insert_handle->subtree)) {
+ te_dragged->drag_data->insert_type = TE_INSERT_INTO;
+ }
+ else {
+ te_dragged->drag_data->insert_type = TE_INSERT_BEFORE;
+ te_dragged->drag_data->insert_handle = insert_handle->subtree.first;
+ }
+ }
+ else {
+ te_dragged->drag_data->insert_type = TE_INSERT_AFTER;
+ }
}
else if (view_mval[1] > (insert_handle->ys + (2 * margin))) {
te_dragged->drag_data->insert_type = TE_INSERT_BEFORE;
More information about the Bf-blender-cvs
mailing list