diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-06-03 23:51:50 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-06-03 23:51:50 +0200 |
commit | de2ee1e822127d226fb7c0cee2853f5358bfd2c2 (patch) | |
tree | 7a9d67aa6036cdd8ed2e84f791da3a8e784f188c | |
parent | d18d7bd84999f4e901c914ea08656a215ad5af46 (diff) |
winwidget_render_image: Use round to calculate coordinates.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/winwidget.c | 12 |
2 files changed, 10 insertions, 6 deletions
@@ -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", |