From 0e067c75fb73a72914d789d2922a3828523c11a8 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Thu, 3 May 2007 21:33:24 +0000 Subject: [PATCH] 2007-05-03 Jim Evins * src/label-image.c: (gl_label_image_init), (draw_object): Scale default pixbuf up, to prevent bluring. Use cairo_fill to render image. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@658 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/ChangeLog | 6 ++++++ glabels2/src/label-image.c | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 6c5e4b63..2439da75 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,9 @@ +2007-05-03 Jim Evins + + * src/label-image.c: (gl_label_image_init), (draw_object): + Scale default pixbuf up, to prevent bluring. Use cairo_fill to + render image. + 2007-05-02 Jim Evins * src/view.c: (draw_select_region_layer), (motion_notify_event_cb), diff --git a/glabels2/src/label-image.c b/glabels2/src/label-image.c index 525bb6ed..5408dcfd 100644 --- a/glabels2/src/label-image.c +++ b/glabels2/src/label-image.c @@ -87,9 +87,13 @@ gl_label_image_class_init (glLabelImageClass *class) static void gl_label_image_init (glLabelImage *limage) { + GdkPixbuf *pixbuf; + if ( default_pixbuf == NULL ) { - default_pixbuf = - gdk_pixbuf_new_from_xpm_data ((const char **)checkerboard_xpm); + pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)checkerboard_xpm); + default_pixbuf = + gdk_pixbuf_scale_simple (pixbuf, 128, 128, GDK_INTERP_NEAREST); + g_object_unref (pixbuf); } limage->priv = g_new0 (glLabelImagePrivate, 1); @@ -308,11 +312,10 @@ draw_object (glLabelObject *object, cairo_save (cr); cairo_rectangle (cr, 0.0, 0.0, w, h); - cairo_clip (cr); cairo_scale (cr, w/image_w, h/image_h); gdk_cairo_set_source_pixbuf (cr, (GdkPixbuf *)pixbuf, 0, 0); - cairo_paint (cr); + cairo_fill (cr); cairo_restore (cr); -- 2.39.5