Fix T97152: Selection tools do nothing in particle hair edit

Regression in [0] which caused canceled PRESS events not to generate
CLICK_DRAG.

Resolve by checking for an active brush tool in poll instead of the
PARTICLE_OT_brush_edit invoke function.

[0]: 4d0f846b93,
This commit is contained in:
Campbell Barton 2022-04-13 16:22:17 +10:00
parent 9a659f2573
commit 567aad9dcd
Notes: blender-bot 2023-02-14 03:52:45 +01:00
Referenced by issue #97152, Regression: Selection tools do nothing in particle hair edit?
1 changed files with 6 additions and 5 deletions

View File

@ -4693,10 +4693,6 @@ static int brush_edit_init(bContext *C, wmOperator *op)
BrushEdit *bedit;
float min[3], max[3];
if (!WM_toolsystem_active_tool_is_brush(C)) {
return 0;
}
/* set the 'distance factor' for grabbing (used in comb etc) */
INIT_MINMAX(min, max);
PE_minmax(depsgraph, scene, view_layer, min, max);
@ -5033,6 +5029,11 @@ static void brush_edit_cancel(bContext *UNUSED(C), wmOperator *op)
brush_edit_exit(op);
}
static bool brush_edit_poll(bContext *C)
{
return PE_poll_view3d(C) && WM_toolsystem_active_tool_is_brush(C);
}
void PARTICLE_OT_brush_edit(wmOperatorType *ot)
{
/* identifiers */
@ -5045,7 +5046,7 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot)
ot->invoke = brush_edit_invoke;
ot->modal = brush_edit_modal;
ot->cancel = brush_edit_cancel;
ot->poll = PE_poll_view3d;
ot->poll = brush_edit_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;