Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-08-31 17:04:03 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-08-31 17:04:03 +0400
commit6b2aa6f863cfcc60ba90cf6accd7a302c4133ff3 (patch)
tree91159431acda24e64ba0107edb0cceeebd190484 /source/blender/editors/sculpt_paint
parent533192013fe8983d7e2b6d6b2b58dfe87d2b319a (diff)
Fix #32408: image editor does not show paint brush circle on loading a .blend
file that has paint mode enabled.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 953215b83aa..96f1f60a7e5 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -5334,12 +5334,25 @@ static void toggle_paint_cursor(bContext *C, int enable)
* ensure that the cursor is hidden when not in paint mode */
void ED_space_image_paint_update(wmWindowManager *wm, ToolSettings *settings)
{
+ wmWindow *win;
+ ScrArea *sa;
ImagePaintSettings *imapaint = &settings->imapaint;
+ int enabled = FALSE;
- if (!imapaint->paintcursor) {
- imapaint->paintcursor =
- WM_paint_cursor_activate(wm, image_paint_poll,
- brush_drawcursor, NULL);
+ for (win = wm->windows.first; win; win = win->next)
+ for (sa = win->screen->areabase.first; sa; sa = sa->next)
+ if (sa->spacetype == SPACE_IMAGE)
+ if (((SpaceImage*)sa->spacedata.first)->mode == SI_MODE_PAINT)
+ enabled = TRUE;
+
+ if (enabled) {
+ BKE_paint_init(&imapaint->paint, PAINT_CURSOR_TEXTURE_PAINT);
+
+ if (!imapaint->paintcursor) {
+ imapaint->paintcursor =
+ WM_paint_cursor_activate(wm, image_paint_poll,
+ brush_drawcursor, NULL);
+ }
}
}