aboutsummaryrefslogtreecommitdiff
path: root/fastiv-view.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-08 08:00:18 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-09 06:03:02 +0100
commita135d6f332c31b11b8d4c4b3c3cfb0b500beffb7 (patch)
tree75d955d15a4435dee69c441f342e32276a49bd8d /fastiv-view.c
parenta0408abdf29127a057cd61ee7106b633ba2aaf12 (diff)
downloadfiv-a135d6f332c31b11b8d4c4b3c3cfb0b500beffb7.tar.gz
fiv-a135d6f332c31b11b8d4c4b3c3cfb0b500beffb7.tar.xz
fiv-a135d6f332c31b11b8d4c4b3c3cfb0b500beffb7.zip
Enable opening images from the browser
Also, make it possible to go back, in a roughly implemented manner.
Diffstat (limited to 'fastiv-view.c')
-rw-r--r--fastiv-view.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fastiv-view.c b/fastiv-view.c
index 1cf4f17..037008d 100644
--- a/fastiv-view.c
+++ b/fastiv-view.c
@@ -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);