diff options
author | Ton Roosendaal <ton@blender.org> | 2004-05-08 13:42:33 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-05-08 13:42:33 +0400 |
commit | 9c3607b1fff528ef1e0f7254a1409da9c839c156 (patch) | |
tree | 713f89541878c935f6602bf6639b4fd91ea1922d /source | |
parent | ac47d081c4025d20074f5afadb5121135e8c055a (diff) |
Fixed little annoyance that caused previewrender not to clear sometimes.
For example when no Texture exists, and you switch from material to
texture buttons.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/previewrender.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c index 2304ed2d081..9cf3caa92c9 100644 --- a/source/blender/src/previewrender.c +++ b/source/blender/src/previewrender.c @@ -1020,7 +1020,15 @@ void BIF_previewrender(SpaceButs *sbuts) if(ob && ob->type==OB_LAMP) la= ob->data; } - if(mat==NULL && tex==NULL && la==NULL && wrld==NULL) return; + /* return: when no active block to render. but we do draw black if possible */ + if(mat==NULL && tex==NULL && la==NULL && wrld==NULL) { + if(sbuts->rect) { + memset(sbuts->rect, 0, sizeof(int)*PR_RECTX*PR_RECTY); + sbuts->cury= PR_RECTY; + addqueue(curarea->win, REDRAW, 1); + } + return; + } har.flarec= 0; /* below is a test for postrender flare */ @@ -1103,7 +1111,7 @@ void BIF_previewrender(SpaceButs *sbuts) set_previewrect(sbuts->area->win, PR_XMIN, PR_YMIN, PR_XMAX, PR_YMAX); - if(sbuts->rect==0) { + if(sbuts->rect==NULL) { sbuts->rect= MEM_callocN(sizeof(int)*PR_RECTX*PR_RECTY, "butsrect"); /* built in emboss */ |