From: Jim Evins Date: Thu, 3 May 2007 21:33:24 +0000 (+0000) Subject: 2007-05-03 Jim Evins X-Git-Tag: glabels-2_3_0~338 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0e067c75fb73a72914d789d2922a3828523c11a8;p=glabels 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 --- 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);