aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-10-16 10:04:00 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-10-16 10:07:32 +0200
commitfa7b1631f0a0ca911ad9a0aa41278f389f2b45eb (patch)
treec3e2203111d2dc097f91134a7ec50c89aa0ce159
parent70a4729f363c25684098953cad99ed9af4e23bf7 (diff)
downloadfiv-fa7b1631f0a0ca911ad9a0aa41278f389f2b45eb.tar.gz
fiv-fa7b1631f0a0ca911ad9a0aa41278f389f2b45eb.tar.xz
fiv-fa7b1631f0a0ca911ad9a0aa41278f389f2b45eb.zip
Round coordinates for image centring
-rw-r--r--fastiv-view.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fastiv-view.c b/fastiv-view.c
index ac312d5..edddeb4 100644
--- a/fastiv-view.c
+++ b/fastiv-view.c
@@ -129,9 +129,9 @@ fastiv_view_draw(GtkWidget *widget, cairo_t *cr)
double x = 0;
double y = 0;
if (w < allocation.width)
- x = (allocation.width - w) / 2;
+ x = round((allocation.width - w) / 2.);
if (h < allocation.height)
- y = (allocation.height - h) / 2;
+ y = round((allocation.height - h) / 2.);
cairo_scale(cr, self->scale, self->scale);
cairo_set_source_surface(cr, self->surface,