summaryrefslogtreecommitdiff
path: root/src/eom-scroll-view.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-10-02 15:00:03 +0300
committermonsta <[email protected]>2015-10-02 15:00:03 +0300
commit3259401936afff640656c276648c4f769b3b969c (patch)
tree4ff4387f8bea9bbd72641aca18d2e733c14250b5 /src/eom-scroll-view.c
parentd6ccb38de4b6a86ae5642cf38ce4b44747b0559a (diff)
downloadeom-3259401936afff640656c276648c4f769b3b969c.tar.bz2
eom-3259401936afff640656c276648c4f769b3b969c.tar.xz
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
Diffstat (limited to 'src/eom-scroll-view.c')
-rw-r--r--src/eom-scroll-view.c9
1 files 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);