diff options
author | Ton Roosendaal <ton@blender.org> | 2005-10-03 14:10:19 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-10-03 14:10:19 +0400 |
commit | 1c72a19fd83d62e285f9280b7676da4a42636e3c (patch) | |
tree | 56226faa0d96c0e406cdb58ea796aa0e96954a4c | |
parent | fd7ef55a69fdd23d86b00cd288b934bb1c926fa0 (diff) |
Bugfix #3133
- Rendering an image with Border didn't check for sizes smaller than 1
pixel yet.
Related to this code I found 2 other fixes:
- Themecolor set for drawing in Render Window was not restored correctly,
sometimes causing into wrong Panel (transparency) drawing.
- When rendering an image with Gauss, it now renders by default 1 pixel
extra, which gets stripped. This eliminates the "ugly" darker border
in images.
(Yes, let's make Mr. PixelCounter Goralczyk happy! :)
-rw-r--r-- | source/blender/render/intern/source/initrender.c | 15 | ||||
-rw-r--r-- | source/blender/src/renderwin.c | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index 259c84750d2..143d4867d08 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -684,7 +684,7 @@ static void initparts(void) if(pa->x>0 && pa->y>0) { /* Gauss needs 1 pixel extra to work */ - if(xparts*yparts>1 && (R.r.mode & R_GAUSS)) { + if((R.r.mode & R_GAUSS)) { pa->minx-= 1; pa->miny-= 1; pa->maxx+= 1; @@ -692,6 +692,7 @@ static void initparts(void) pa->x+= 2; pa->y+= 2; } + printf("part %d %d\n", pa->x, pa->y); BLI_addtail(&R.parts, pa); } else MEM_freeN(pa); @@ -719,7 +720,7 @@ static void addparttorect(Part *pa) int y, heigth, len, copylen; /* calc the right offset in rects, zbuffer cannot exist... */ - + printf("add part %d %d\n", pa->x, pa->y); if(pa->rect==NULL) return; rtp= pa->rect; @@ -964,6 +965,12 @@ static void mainRenderLoop(void) /* here the PART and FIELD loops */ if(R.r.mode & R_MBLUR) set_mblur_offs(R.osa-blur); initparts(); /* always do, because of border */ + if(R.parts.first==NULL) { + G.afbreek=1; + error("Image too small"); + break; + } + setpart(R.parts.first); RE_local_init_render_display(); @@ -1020,7 +1027,7 @@ static void mainRenderLoop(void) /* here the PART and FIELD loops */ if( (R.r.mode & R_BORDER) && (R.r.mode & R_MOVIECROP)); else { /* HANDLE PART OR BORDER */ - if(totparts>1 || (R.r.mode & R_BORDER)) { + if(totparts>1 || (R.r.mode & R_BORDER) || (R.r.mode & R_GAUSS)) { pa->rect= R.rectot; R.rectot= NULL; @@ -1044,7 +1051,7 @@ static void mainRenderLoop(void) /* here the PART and FIELD loops */ if(R.r.mode & R_PANORAMA) R.rectx*= R.r.xparts; - if(totparts>1 || (R.r.mode & R_BORDER)) { + if(totparts>1 || (R.r.mode & R_BORDER) || (R.r.mode & R_GAUSS)) { int a; if(R.rectot) MEM_freeN(R.rectot); diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c index 46e59e8aacb..613f7a6df5f 100644 --- a/source/blender/src/renderwin.c +++ b/source/blender/src/renderwin.c @@ -287,6 +287,8 @@ static void renderwin_draw_render_info(RenderWin *rw) glRasterPos2i(12, 5); BMF_DrawString(G.fonts, rw->render_text); } + + BIF_SetTheme(curarea); // restore theme } } |