[glide] glide-image.c: Properly scale images when printing. Fixes printing and thumbnails
- From: Robert Carr <racarr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glide] glide-image.c: Properly scale images when printing. Fixes printing and thumbnails
- Date: Sat, 5 Jun 2010 19:48:54 +0000 (UTC)
commit 6c2ddbd6ef1d6ff8372589e9da60674c216e7262
Author: Robert Carr <racarr Valentine localdomain>
Date: Mon May 24 18:28:33 2010 -0400
glide-image.c: Properly scale images when printing. Fixes printing and thumbnails
libglide/glide-image.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/libglide/glide-image.c b/libglide/glide-image.c
index dd28f2d..477b495 100644
--- a/libglide/glide-image.c
+++ b/libglide/glide-image.c
@@ -275,7 +275,7 @@ glide_image_print (GlideActor *actor,
cairo_t *cr)
{
GlideImage *image = GLIDE_IMAGE (actor);
- GdkPixbuf *p;
+ GdkPixbuf *p, *s;
gfloat width, height, x, y;
gchar *r;
@@ -285,14 +285,16 @@ glide_image_print (GlideActor *actor,
r = glide_actor_get_resource_path (actor, image->priv->filename);
// TODO: Error
- p = gdk_pixbuf_new_from_file_at_size (r, width, height, NULL);
- gdk_cairo_set_source_pixbuf (cr, p, x, y);
+ p = gdk_pixbuf_new_from_file (r, NULL);
+ s = gdk_pixbuf_scale_simple (p, width, height, GDK_INTERP_HYPER);
+ gdk_cairo_set_source_pixbuf (cr, s, x, y);
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
g_free (r);
g_object_unref (G_OBJECT (p));
+ g_object_unref (G_OBJECT (s));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]