diff options
-rw-r--r-- | src/eom-scroll-view.c | 9 |
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); |