From 01ed483b50f506fcba928af43e2ca017897e7c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Fri, 6 Feb 2015 08:52:44 +0100 Subject: Round integer cast of image offset during rendering; fixes issue #197 --- image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'image.c') diff --git a/image.c b/image.c index fe2c6e8..ddc75df 100644 --- a/image.c +++ b/image.c @@ -452,7 +452,7 @@ void img_render(img_t *img) * - full image drawn on part of window */ if (img->x <= 0) { - sx = -img->x / img->zoom; + sx = -img->x / img->zoom + 0.5; sw = win->w / img->zoom; dx = 0; dw = win->w; @@ -463,7 +463,7 @@ void img_render(img_t *img) dw = img->w * img->zoom; } if (img->y <= 0) { - sy = -img->y / img->zoom; + sy = -img->y / img->zoom + 0.5; sh = win->h / img->zoom; dy = 0; dh = win->h; -- cgit v1.2.3