Fix T43941: Grease pencil eraser outline vanishes

This commit is contained in:
Campbell Barton 2015-03-10 18:17:02 +11:00
parent afa8a0ac19
commit f1a0c2a4f0
Notes: blender-bot 2023-02-14 09:23:49 +01:00
Referenced by issue #43941, Grease pencil: Eraser icon disappear while erasing
1 changed files with 3 additions and 6 deletions

View File

@ -1942,18 +1942,15 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
*/
if (event->type == LEFTMOUSE) {
/* restore drawmode to default */
// XXX: no need for this... this should just revert by itself
if (p->paintmode == GP_PAINTMODE_ERASER)
gpencil_draw_toggle_eraser_cursor(C, p, false);
p->paintmode = RNA_enum_get(op->ptr, "mode");
}
else if (event->type == RIGHTMOUSE) {
/* turn on eraser */
p->paintmode = GP_PAINTMODE_ERASER;
gpencil_draw_toggle_eraser_cursor(C, p, true);
}
gpencil_draw_toggle_eraser_cursor(C, p, p->paintmode == GP_PAINTMODE_ERASER);
/* not painting, so start stroke (this should be mouse-button down) */
p = gpencil_stroke_begin(C, op);