From 3259401936afff640656c276648c4f769b3b969c Mon Sep 17 00:00:00 2001 From: monsta Date: Fri, 2 Oct 2015 15:00:03 +0300 Subject: EomScrollView: clip all types of images to the visible image area previously it wasn't done for SVGs, now it is. taken from https://git.gnome.org/browse/eog/commit?id=3fb558e1861d3d75bca23946fcf3f62c80daeeec --- src/eom-scroll-view.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/eom-scroll-view.c b/src/eom-scroll-view.c index 9b9f0d0..ccd5833 100644 --- a/src/eom-scroll-view.c +++ b/src/eom-scroll-view.c @@ -1299,6 +1299,13 @@ display_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer data) cairo_fill (cr); } + /* Make sure the image is only drawn as large as needed. + * This is especially necessary for SVGs where there might + * be more image data available outside the image boundaries. + */ + cairo_rectangle (cr, xofs, yofs, scaled_width, scaled_height); + cairo_clip (cr); + #ifdef HAVE_RSVG if (eom_image_is_svg (view->priv->image)) { cairo_matrix_t matrix, translate, scale; @@ -1345,8 +1352,6 @@ display_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer data) } else #endif /* HAVE_RSVG */ { - cairo_rectangle (cr, xofs, yofs, scaled_width, scaled_height); - cairo_clip (cr); cairo_scale (cr, priv->zoom, priv->zoom); cairo_set_source_surface (cr, priv->surface, xofs/priv->zoom, yofs/priv->zoom); cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_PAD); -- cgit v1.2.1