Round coordinates for image centring

This commit is contained in:
Přemysl Eric Janouch 2021-10-16 10:04:00 +02:00
parent 70a4729f36
commit fa7b1631f0
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 2 additions and 2 deletions

View File

@ -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,