[Bf-blender-cvs] [4947aff2b99] soc-2020-outliner: Outliner: Autoscroll on drag and drop

Nathan Craddock noreply at git.blender.org
Tue Jun 30 04:25:57 CEST 2020


Commit: 4947aff2b99971ca73cb98dbcf0cdba791ed15dc
Author: Nathan Craddock
Date:   Mon Jun 29 20:23:28 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rB4947aff2b99971ca73cb98dbcf0cdba791ed15dc

Outliner: Autoscroll on drag and drop

Scroll the view when dragging elements near the borders. This works in
all 4 directions. Uses the VIEW2D_OT_edge_pan operator.

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

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 c2c9f3a5bfb..70a628eead0 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -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)) {



More information about the Bf-blender-cvs mailing list