Outliner: Add auto scrolling during drag and drop

Pan the view when dragging elements near the borders. This uses the same
operator that scrolls the region during modifiers drag and drop.
This commit is contained in:
Nathan Craddock 2020-06-29 20:23:28 -06:00
parent 21c2a64e79
commit 7dbfc864e6
Notes: blender-bot 2023-02-13 16:54:48 +01:00
Referenced by issue #93685, Regression: Dragging an ID from the Outliner of a window cannot be dropped in another window
1 changed files with 3 additions and 0 deletions

View File

@ -907,6 +907,9 @@ static int outliner_item_drag_drop_invoke(bContext *C,
return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH);
}
/* Scroll view when dragging near edges */
WM_operator_name_call(C, "VIEW2D_OT_edge_pan", WM_OP_INVOKE_DEFAULT, NULL);
wmDrag *drag = WM_event_start_drag(C, data.icon, WM_DRAG_ID, NULL, 0.0, WM_DRAG_NOP);
if (ELEM(GS(data.drag_id->name), ID_OB, ID_GR)) {