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
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-12-04 21:12:10 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-12-04 21:12:10 +0400
commit17493c77f4f876910436648f18c0125d20f24809 (patch)
tree1f944f17d46239e211929eeaed621db60b9fa87b /source/blender/editors/interface
parent5c82926f94f333c326ff1f835b18f6d92cc6afd8 (diff)
Fixed dark edges on preview widget sides: it was interpolating beyond the image bounds
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_draw.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index b9c4dbcf5f7..12187283470 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1480,7 +1480,13 @@ static ImBuf *scale_trackpreview_ibuf(ImBuf *ibuf, float zoomx, float zoomy)
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);
}
}