Fix T86609: GPencil: Sculpt brush cursor disappears on undo.

Regression from rB2a8122fb65c5, somehow that piece of code was lost
during the refactor.
This commit is contained in:
Bastien Montagne 2021-03-17 11:37:10 +01:00
parent ac60e64745
commit e6bdd57191
Notes: blender-bot 2023-02-14 05:28:01 +01:00
Referenced by issue #86609, Red brush width circle around cursor disappears after undo in Grease Pencil Sculpt Mode
1 changed files with 22 additions and 0 deletions

View File

@ -224,6 +224,28 @@ static void ed_undo_step_post(bContext *C,
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
ScrArea *area = CTX_wm_area(C);
/* Set special modes for grease pencil */
if (area != NULL && (area->spacetype == SPACE_VIEW3D)) {
Object *obact = CTX_data_active_object(C);
if (obact && (obact->type == OB_GPENCIL)) {
/* set cursor */
if (ELEM(obact->mode,
OB_MODE_PAINT_GPENCIL,
OB_MODE_SCULPT_GPENCIL,
OB_MODE_WEIGHT_GPENCIL,
OB_MODE_VERTEX_GPENCIL)) {
ED_gpencil_toggle_brush_cursor(C, true, NULL);
}
else {
ED_gpencil_toggle_brush_cursor(C, false, NULL);
}
/* set workspace mode */
Base *basact = CTX_data_active_base(C);
ED_object_base_activate(C, basact);
}
}
/* App-Handlers (post). */
{