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
path: root/source
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2011-04-27 05:16:24 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2011-04-27 05:16:24 +0400
commit1860c0c56585a132e0e4ee0798158f0f598cf6f8 (patch)
tree6a335a5fbdbce576a883e90da2baf02fc6eed1a7 /source
parentf9cb8f80e702961d55ce2c6ad5c8a33b8b572ba2 (diff)
Fix for bug #26590, `Texture preview fails when path to custom brush
icon is set' * Main problem was calling BKE_icon_changed too much, blocked previews from updating * Also fixed clearing the icon when it's not a valid image path Review link: http://codereview.appspot.com/4356045/
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/render/render_preview.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 239b078a910..905f88c5f90 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -135,14 +135,15 @@ ImBuf* get_brush_icon(Brush *brush)
if (path[0])
brush->icon_imbuf= IMB_loadiffname(path, flags);
}
+
+ if (brush->icon_imbuf)
+ BKE_icon_changed(BKE_icon_getid(&brush->id));
}
}
}
if (!(brush->icon_imbuf))
brush->id.icon_id = 0;
- else
- BKE_icon_changed(BKE_icon_getid(&(brush->id)));
return brush->icon_imbuf;
}
@@ -1256,10 +1257,11 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat
br->icon_imbuf= get_brush_icon(br);
+ memset(sp->pr_rect, 0x888888, sp->sizex*sp->sizey*sizeof(unsigned int));
+
if(!(br->icon_imbuf) || !(br->icon_imbuf->rect))
return;
- memset(sp->pr_rect, 0x888888, sp->sizex*sp->sizey*sizeof(unsigned int));
icon_copy_rect(br->icon_imbuf, sp->sizex, sp->sizey, sp->pr_rect);
*do_update= 1;