Enable opening images from the browser

Also, make it possible to go back, in a roughly implemented manner.
This commit is contained in:
2021-11-08 08:00:18 +01:00
parent a0408abdf2
commit a135d6f332
3 changed files with 85 additions and 18 deletions

View File

@@ -131,6 +131,11 @@ fastiv_view_draw(GtkWidget *widget, cairo_t *cr)
if (h < allocation.height)
y = round((allocation.height - h) / 2.);
// XXX: The rounding together with padding may result in up to
// a pixel's worth of made-up picture data.
cairo_rectangle(cr, x, y, w, h);
cairo_clip(cr);
cairo_scale(cr, self->scale, self->scale);
cairo_set_source_surface(
cr, self->surface, x / self->scale, y / self->scale);