summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/winwidget.c12
2 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index e3ae0f1..7b9f47b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+git HEAD
+
+ * Fix omitted image borders at high zoom levels
+
Tue Jun 1 10:21:19 CEST 2010 Daniel Friesel <derf@chaosdorf.de>
* Release v1.6
diff --git a/src/winwidget.c b/src/winwidget.c
index 6ab39e2..43cbf9e 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -466,17 +466,17 @@ void winwidget_render_image(winwidget winwid, int resize, int alias)
dy = 0;
if (winwid->im_x < 0)
- sx = 0 - (winwid->im_x / winwid->zoom);
+ sx = 0 - round(winwid->im_x / winwid->zoom);
else
sx = 0;
if (winwid->im_y < 0)
- sy = 0 - (winwid->im_y / winwid->zoom);
+ sy = 0 - round(winwid->im_y / winwid->zoom);
else
sy = 0;
- calc_w = winwid->im_w * winwid->zoom;
- calc_h = winwid->im_h * winwid->zoom;
+ calc_w = round(winwid->im_w * winwid->zoom);
+ calc_h = round(winwid->im_h * winwid->zoom);
dw = (winwid->w - winwid->im_x);
dh = (winwid->h - winwid->im_y);
if (calc_w < dw)
@@ -488,8 +488,8 @@ void winwidget_render_image(winwidget winwid, int resize, int alias)
if (dh > winwid->h)
dh = winwid->h;
- sw = dw / winwid->zoom;
- sh = dh / winwid->zoom;
+ sw = round(dw / winwid->zoom);
+ sh = round(dh / winwid->zoom);
D(5,
("sx: %d sy: %d sw: %d sh: %d dx: %d dy: %d dw: %d dh: %d zoom: %f\n",