[evince] ev-document-misc: Get the image from the source surface in ev_document_misc_render_thumbnail_frame



commit 4b83fa562676fe2fd957924c971150d3777bb3be
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sat Mar 22 12:42:16 2014 +0100

    ev-document-misc: Get the image from the source surface in ev_document_misc_render_thumbnail_frame
    
    When ev_document_misc_render_thumbnail_frame is used to render a
    thumbnail with a frame, and not just the frame itself, ignore the passed
    in size and use the source surface if present, like we do when using
    pixbufs.

 libdocument/ev-document-misc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c
index fdc5fbb..4c3b54f 100644
--- a/libdocument/ev-document-misc.c
+++ b/libdocument/ev-document-misc.c
@@ -142,7 +142,10 @@ ev_document_misc_render_thumbnail_frame (GtkWidget       *widget,
         cairo_t         *cr;
         GtkBorder        border = {0, };
 
-        if (source_pixbuf) {
+        if (source_surface) {
+                width_r = cairo_image_surface_get_width (source_surface);
+                height_r = cairo_image_surface_get_height (source_surface);
+        } else if (source_pixbuf) {
                 g_return_val_if_fail (GDK_IS_PIXBUF (source_pixbuf), NULL);
 
                 width_r = gdk_pixbuf_get_width (source_pixbuf);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]