Revision: 42411
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42411
Author:   nazgul
Date:     2011-12-04 17:12:10 +0000 (Sun, 04 Dec 2011)
Log Message:
-----------
Fixed dark edges on preview widget sides: it was interpolating beyond the image 
bounds

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/editors/interface/interface_draw.c

Modified: 
branches/soc-2011-tomato/source/blender/editors/interface/interface_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/interface/interface_draw.c  
2011-12-04 16:55:46 UTC (rev 42410)
+++ branches/soc-2011-tomato/source/blender/editors/interface/interface_draw.c  
2011-12-04 17:12:10 UTC (rev 42411)
@@ -1480,7 +1480,13 @@
 
        for(y= 0; y<scaleibuf->y; y++) {
                for (x= 0; x<scaleibuf->x; x++) {
-                       bilinear_interpolation(ibuf, scaleibuf, 
((float)x)/zoomx, ((float)y)/zoomy, x, y);
+                       float src_x= ((float)x)/zoomx;
+                       float src_y= ((float)y)/zoomy;
+
+                       CLAMP(src_x, 0, ibuf->x-1.0f);
+                       CLAMP(src_y, 0, ibuf->y-1.0f);
+
+                       bilinear_interpolation(ibuf, scaleibuf, src_x, src_y, 
x, y);
                }
        }
 

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to