Index: source/blender/editors/screen/glutil.c =================================================================== --- source/blender/editors/screen/glutil.c (revision 26698) +++ source/blender/editors/screen/glutil.c (working copy) @@ -429,8 +429,15 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, int lrowlength= glaGetOneInteger(GL_UNPACK_ROW_LENGTH); int subpart_x, subpart_y, tex_w, tex_h; int texid= get_cached_work_texture(&tex_w, &tex_h); - int nsubparts_x= (img_w+(tex_w-1))/tex_w; - int nsubparts_y= (img_h+(tex_h-1))/tex_h; + + /* setup seamless 2=on, 0=off */ + int seamless= ((tex_w2 && tex_h>2)?2:0; + + int offset_x=tex_w-seamless; + int offset_y=tex_h-seamless; + + int nsubparts_x= (img_w+(offset_x-1))/(offset_x); + int nsubparts_y= (img_h+(offset_y-1))/(offset_y); /* Specify the color outside this function, and tex will modulate it. * This is useful for changing alpha without using glPixelTransferf() @@ -450,29 +457,55 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, for (subpart_y=0; subpart_ytex_w)?1:0; + int offset_top= (seamless && remainder_y>tex_h)?1:0; + float rast_x= x+subpart_x*offset_x*xzoom; + float rast_y= y+subpart_y*offset_y*yzoom; - if(format==GL_FLOAT) - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, subpart_w, subpart_h, GL_RGBA, GL_FLOAT, &f_rect[(subpart_y*tex_w)*img_w*4 + (subpart_x*tex_w)*4]); - else - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, subpart_w, subpart_h, GL_RGBA, GL_UNSIGNED_BYTE, &uc_rect[(subpart_y*tex_w)*img_w*4 + (subpart_x*tex_w)*4]); - + /* check if we already got these because we always get 2 more when doing seamless*/ + if(subpart_w<=seamless || subpart_h<=seamless) + continue; + + if(format==GL_FLOAT) { + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, subpart_w, subpart_h, GL_RGBA, GL_FLOAT, &f_rect[subpart_y*offset_y*img_w*4 + subpart_x*offset_x*4]); + + /* add an extra border of pixels so linear looks ok at edges of full image. */ + if(subpart_w