aboutsummaryrefslogtreecommitdiff
path: root/fastiv-view.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-04 19:33:29 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-04 19:42:22 +0100
commit45df774cc9947e195019080608b217f0caf287ef (patch)
tree022817c718bd71ca5cca618c8f9fbbe40bf24747 /fastiv-view.c
parentcdb8d852a6e458ff9fe5f9e7f58aaa55f8ddb1cf (diff)
downloadfiv-45df774cc9947e195019080608b217f0caf287ef.tar.gz
fiv-45df774cc9947e195019080608b217f0caf287ef.tar.xz
fiv-45df774cc9947e195019080608b217f0caf287ef.zip
Fix scaling in the view, as in the browser
The source pattern needs to be padded.
Diffstat (limited to 'fastiv-view.c')
-rw-r--r--fastiv-view.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fastiv-view.c b/fastiv-view.c
index 966a1a7..1cf4f17 100644
--- a/fastiv-view.c
+++ b/fastiv-view.c
@@ -135,8 +135,10 @@ fastiv_view_draw(GtkWidget *widget, cairo_t *cr)
cairo_set_source_surface(
cr, self->surface, x / self->scale, y / self->scale);
+ cairo_pattern_t *pattern = cairo_get_source(cr);
+ cairo_pattern_set_extend(pattern, CAIRO_EXTEND_PAD);
// TODO(p): Prescale it ourselves to an off-screen bitmap, gamma-correctly.
- cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_GOOD);
+ cairo_pattern_set_filter(pattern, CAIRO_FILTER_GOOD);
cairo_paint(cr);
return TRUE;