diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-03-10 17:56:41 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-03-10 17:56:41 +0300 |
commit | 08cde7c785e38f44af2e3c2584e1f88a31c38782 (patch) | |
tree | 9c9c640a3106e0ef09c51b3b6c6cd1fe695535cd /source/blender/editors/space_outliner/outliner_ops.c | |
parent | 8e303aae255be2ef45d5818af046de7c22312aa4 (diff) |
Fix incorrect positioning of collection when dropping it after expanded one
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_ops.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_ops.c | 15 |
1 files changed, 14 insertions, 1 deletions
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; |