[gnome-font-viewer] font-model: make sure to scale pixbufs as we create them



commit 93a102bd485efdb1cb857ef094fe29f63a4b4270
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Aug 20 09:03:04 2013 -0700

    font-model: make sure to scale pixbufs as we create them
    
    Or the first time they will be displayed at full size, which is now
    256px.

 src/font-model.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/font-model.c b/src/font-model.c
index 303a578..2a52339 100644
--- a/src/font-model.c
+++ b/src/font-model.c
@@ -212,9 +212,17 @@ create_thumbnail (ThumbInfoData *thumb_info)
   g_clear_object (&info);
 
   if (pixbuf != NULL)
-      surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, thumb_info->self->priv->scale_factor,
-                                                      NULL);
-  g_clear_object (&pixbuf);
+      {
+          GdkPixbuf *scaled = gdk_pixbuf_scale_simple (pixbuf,
+                                                       128 * thumb_info->self->priv->scale_factor,
+                                                       128 * thumb_info->self->priv->scale_factor,
+                                                       GDK_INTERP_BILINEAR);
+          g_object_unref (pixbuf);
+
+          surface = gdk_cairo_surface_create_from_pixbuf (scaled, thumb_info->self->priv->scale_factor,
+                                                          NULL);
+          g_object_unref (scaled);
+      }
 
   return surface;
 }


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