[Bf-blender-cvs] [0327a464ba4] master: Fix dragging items in the outliner
Campbell Barton
noreply at git.blender.org
Fri Mar 11 01:48:34 CET 2022
Commit: 0327a464ba40db4c555831520c8a5dd2248e47b0
Author: Campbell Barton
Date: Fri Mar 11 10:08:25 2022 +1100
Branches: master
https://developer.blender.org/rB0327a464ba40db4c555831520c8a5dd2248e47b0
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.
===================================================================
M source/blender/editors/space_outliner/outliner_select.cc
===================================================================
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]);
More information about the Bf-blender-cvs
mailing list