]> git.sur5r.net Git - glabels/commitdiff
2007-05-03 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Thu, 3 May 2007 21:33:24 +0000 (21:33 +0000)
committerJim Evins <evins@snaught.com>
Thu, 3 May 2007 21:33:24 +0000 (21:33 +0000)
* 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
glabels2/src/label-image.c

index 6c5e4b63def17e771eac5381e60aa74811406659..2439da7583e92947fe47260cf75d1f3fcf9a2221 100644 (file)
@@ -1,3 +1,9 @@
+2007-05-03  Jim Evins  <evins@snaught.com>
+
+       * 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  <evins@snaught.com>
 
        * src/view.c: (draw_select_region_layer), (motion_notify_event_cb),
index 525bb6ed494942a97ac36cef00f65fc46fcfc1e0..5408dcfdfda5c7318ede7703faf007b1a086f17a 100644 (file)
@@ -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);