From 558ec9c64c34d52e9b85f9324fbffb44a2936789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=98=81=EC=83=81=EC=9D=B8=EC=8B=9D=EA=B8=B0=EC=88=A0=20C?= =?UTF-8?q?ell=20=EC=9D=B4=EA=B4=91=EA=B5=AD?= Date: Fri, 9 Feb 2018 14:22:14 +0900 Subject: [PATCH] coordinate calcuration fiex in place_image(). change data type from int to float, for bilienar interpolation --- src/image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/image.c b/src/image.c index ac1b6296..ab1e8da2 100644 --- a/src/image.c +++ b/src/image.c @@ -749,8 +749,8 @@ void place_image(image im, int w, int h, int dx, int dy, image canvas) for(c = 0; c < im.c; ++c){ for(y = 0; y < h; ++y){ for(x = 0; x < w; ++x){ - int rx = ((float)x / w) * im.w; - int ry = ((float)y / h) * im.h; + float rx = ((float)x / w) * im.w; + float ry = ((float)y / h) * im.h; float val = bilinear_interpolate(im, rx, ry, c); set_pixel(canvas, x + dx, y + dy, c, val); }