Fix T102650: Wrong cursor in greasepencil fill operation

Caused by {rBbf8507414889}

Above comit set the wrong cursors (WM_CURSOR_DEFAULT).
When releasing MMB, we need to return to WM_CURSOR_PAINT_BRUSH.
When exiting, we need to return to WM_CURSOR_DOT (since this is the
default cursor for the tool, see `_defs_gpencil_paint` >
`generate_from_brushes`)

Maniphest Tasks: T102650

Differential Revision: https://developer.blender.org/D16591
This commit is contained in:
Philipp Oeser 2022-11-23 14:05:53 +01:00
parent ee56c46c15
commit b0810f788c
Notes: blender-bot 2023-02-13 13:58:36 +01:00
Referenced by issue #102650, Regression: Cursor arrow shows up after fill operation execution
1 changed files with 2 additions and 2 deletions

View File

@ -2461,7 +2461,7 @@ static void gpencil_fill_exit(bContext *C, wmOperator *op)
if (tgpf->draw_handle_3d) {
ED_region_draw_cb_exit(tgpf->region->type, tgpf->draw_handle_3d);
}
WM_cursor_set(CTX_wm_window(C), WM_CURSOR_DEFAULT);
WM_cursor_set(CTX_wm_window(C), WM_CURSOR_DOT);
/* Remove depth buffer in cache. */
if (tgpf->depths) {
@ -3011,7 +3011,7 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
tgpf->initial_length = len_v2(mlen);
}
if (event->val == KM_RELEASE) {
WM_cursor_set(CTX_wm_window(C), WM_CURSOR_DEFAULT);
WM_cursor_modal_set(CTX_wm_window(C), WM_CURSOR_PAINT_BRUSH);
tgpf->mouse_init[0] = -1.0f;
tgpf->mouse_init[1] = -1.0f;