From 78017916f7c7a8ec8907c9b993214ff8ec3c3557 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 4 Jun 2020 20:17:05 +1000 Subject: Fix error removing the image paint cursor Mix up with imapaint.paintcursor & imapaint.paint.paint_cursor Remove imapaint.paintcursor since it wasn't used. Also rename paint_cursor_start_explicit() to paint_cursor_start(), removing the existing paint_cursor_start() since it took the paint struct from the context, a value that's known by all callers. --- source/blender/editors/sculpt_paint/paint_image.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/sculpt_paint/paint_image.c') diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index cf2a36de6aa..6ad4d1e650a 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -785,14 +785,15 @@ static void toggle_paint_cursor(bContext *C, int enable) { Scene *scene = CTX_data_scene(C); ToolSettings *settings = scene->toolsettings; + Paint *p = &settings->imapaint.paint; - if (settings->imapaint.paintcursor && !enable) { - WM_paint_cursor_end(settings->imapaint.paintcursor); - settings->imapaint.paintcursor = NULL; + if (p->paint_cursor && !enable) { + WM_paint_cursor_end(p->paint_cursor); + p->paint_cursor = NULL; paint_cursor_delete_textures(); } else if (enable) { - paint_cursor_start(C, image_paint_poll); + paint_cursor_start(p, image_paint_poll); } } @@ -822,7 +823,7 @@ void ED_space_image_paint_update(Main *bmain, wmWindowManager *wm, Scene *scene) if (enabled) { BKE_paint_init(bmain, scene, PAINT_MODE_TEXTURE_2D, PAINT_CURSOR_TEXTURE_PAINT); - paint_cursor_start_explicit(&imapaint->paint, image_paint_poll); + paint_cursor_start(&imapaint->paint, image_paint_poll); } else { paint_cursor_delete_textures(); -- cgit v1.2.3