diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-16 21:16:28 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-16 21:29:22 +0300 |
commit | 40a8c4908818bdf1c4628a389803a9a26e2d68f1 (patch) | |
tree | bf1eed08131bad513b737e4016b5557c8d86768d /source/blender/editors/gpencil/gpencil_paint.c | |
parent | 087a4898676d744d4aaa46a59b47186825495820 (diff) |
Revert new grease pencil cursor for paint modes
This reverts commit a412f49e7580a and 873c756e5dd73. The change was only
supposed to affect grease pencil, but also changed the cursor for sculpt mode,
where it's not clearly visible. Since this has not been quickly resolved I'm
reverting the commit.
Ref D5036.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_paint.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 041704d8473..c5e91bd2cab 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -2392,6 +2392,10 @@ static void gpencil_draw_exit(bContext *C, wmOperator *op) WM_cursor_modal_restore(CTX_wm_window(C)); } else { + /* or restore paint if 3D view */ + if ((p) && (p->paintmode == GP_PAINTMODE_ERASER)) { + WM_cursor_modal_set(p->win, CURSOR_STD); + } /* drawing batch cache is dirty now */ bGPdata *gpd = CTX_data_gpencil_data(C); @@ -2405,6 +2409,8 @@ static void gpencil_draw_exit(bContext *C, wmOperator *op) gpencil_undo_finish(); /* cleanup */ + WM_cursor_modal_set(p->win, CURSOR_STD); + gp_paint_cleanup(p); gp_session_cleanup(p); ED_gpencil_toggle_brush_cursor(C, true, NULL); @@ -2469,6 +2475,18 @@ static int gpencil_draw_init(bContext *C, wmOperator *op, const wmEvent *event) /* ------------------------------- */ +/* ensure that the correct cursor icon is set */ +static void gpencil_draw_cursor_set(tGPsdata *p) +{ + Brush *brush = p->brush; + if ((p->paintmode == GP_PAINTMODE_ERASER) || (brush->gpencil_tool == GPAINT_TOOL_ERASE)) { + WM_cursor_modal_set(p->win, BC_CROSSCURSOR); /* XXX need a better cursor */ + } + else { + WM_cursor_modal_set(p->win, CURSOR_NONE); + } +} + /* update UI indicators of status, including cursor and header prints */ static void gpencil_draw_status_indicators(bContext *C, tGPsdata *p) { @@ -3183,6 +3201,11 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event else { ED_gpencil_toggle_brush_cursor(C, true, NULL); } + /* set cursor + * NOTE: This may change later (i.e. intentionally via brush toggle, + * or unintentionally if the user scrolls outside the area)... + */ + gpencil_draw_cursor_set(p); /* only start drawing immediately if we're allowed to do so... */ if (RNA_boolean_get(op->ptr, "wait_for_input") == false) { @@ -3749,6 +3772,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) else { /* update status indicators - cursor, header, etc. */ gpencil_draw_status_indicators(C, p); + gpencil_draw_cursor_set(p); /* cursor may have changed outside our control - T44084 */ } /* process last operations before exiting */ |