Outliner: Add auto scrolling during drag and drop
authorNathan Craddock <nzcraddock@gmail.com>
Tue, 30 Jun 2020 02:23:28 +0000 (20:23 -0600)
committerNathan Craddock <nzcraddock@gmail.com>
Tue, 30 Jun 2020 16:57:27 +0000 (10:57 -0600)
Pan the view when dragging elements near the borders. This uses the same
operator that scrolls the region during modifiers drag and drop.

source/blender/editors/space_outliner/outliner_dragdrop.c

index c2c9f3a5bfb528b7a1497ae91194dcb25e463aee..70a628eead0f09865c22e3d50af25616d2579a27 100644 (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)) {