From 3108b7222f5da4c3b84d337bd6a7ec586c20550a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 11 Mar 2022 10:08:25 +1100 Subject: Fix dragging items in the outliner Regression in b8960267dd51f9108b3b49e9b762e6b4d35ae1dc, it's important for box-select to use the drag start to check if the cursor is over an icon. --- source/blender/editors/space_outliner/outliner_select.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index c6b9d9577b5..7cdfa441eaa 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -1662,10 +1662,15 @@ static int outliner_item_do_activate_from_cursor(bContext *C, /* Event can enter-key, then it opens/closes. */ static int outliner_item_activate_invoke(bContext *C, wmOperator *op, const wmEvent *event) { + ARegion *region = CTX_wm_region(C); + const bool extend = RNA_boolean_get(op->ptr, "extend"); const bool use_range = RNA_boolean_get(op->ptr, "extend_range"); const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all"); - return outliner_item_do_activate_from_cursor(C, event->mval, extend, use_range, deselect_all); + + int mval[2]; + WM_event_drag_start_mval(event, region, mval); + return outliner_item_do_activate_from_cursor(C, mval, extend, use_range, deselect_all); } void OUTLINER_OT_item_activate(wmOperatorType *ot) @@ -1756,8 +1761,9 @@ static int outliner_box_select_invoke(bContext *C, wmOperator *op, const wmEvent float view_mval[2]; const bool tweak = RNA_boolean_get(op->ptr, "tweak"); - UI_view2d_region_to_view( - ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); + int mval[2]; + WM_event_drag_start_mval(event, region, mval); + UI_view2d_region_to_view(®ion->v2d, mval[0], mval[1], &view_mval[0], &view_mval[1]); /* Find element clicked on */ TreeElement *te = outliner_find_item_at_y(space_outliner, &space_outliner->tree, view_mval[1]); -- cgit v1.2.3