diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-18 04:58:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-18 05:00:57 +0300 |
commit | 7eaa0b17971ddda65cc4b0f3c9296a07e60431ce (patch) | |
tree | 13bfb5e29a9bcfe00cbf020f116a197f75aa5e5c /source | |
parent | a68edaf11d15f60f4ef5b869c2baf3e37835043b (diff) |
Fix T59366: gpencil eraser shows w/ shape tool
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 2ccaea84e6b..fcfe6132948 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -62,6 +62,7 @@ #include "BKE_tracking.h" #include "WM_api.h" +#include "WM_toolsystem.h" #include "RNA_access.h" #include "RNA_define.h" @@ -1510,8 +1511,16 @@ void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y) glDisable(GL_LINE_SMOOTH); } +static bool gp_brush_cursor_poll(bContext *C) +{ + if (WM_toolsystem_active_tool_is_brush(C)) { + return true; + } + return false; +} + /* Helper callback for drawing the cursor itself */ -static void gp_brush_drawcursor(bContext *C, int x, int y, void *customdata) +static void gp_brush_cursor_draw(bContext *C, int x, int y, void *customdata) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1692,8 +1701,8 @@ void ED_gpencil_toggle_brush_cursor(bContext *C, bool enable, void *customdata) gset->paintcursor = WM_paint_cursor_activate( CTX_wm_manager(C), SPACE_TYPE_ANY, RGN_TYPE_ANY, - NULL, - gp_brush_drawcursor, + gp_brush_cursor_poll, + gp_brush_cursor_draw, (lastpost) ? customdata : NULL); } } |