[gnome-color-manager] trivial: when using pixbuf data, ensure we use the size of the pixbuf, not the window



commit 7b251a437a0e3f7c930949d27e70a2428043fe11
Author: Richard Hughes <richard hughsie com>
Date:   Tue Aug 3 12:40:07 2010 +0100

    trivial: when using pixbuf data, ensure we use the size of the pixbuf, not the window

 libcolor-glib/gcm-sample-window.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libcolor-glib/gcm-sample-window.c b/libcolor-glib/gcm-sample-window.c
index 0a9fcc5..5c39896 100644
--- a/libcolor-glib/gcm-sample-window.c
+++ b/libcolor-glib/gcm-sample-window.c
@@ -131,6 +131,10 @@ gcm_sample_window_set_color (GcmSampleWindow *sample_window, guint8 red, guint8
 		gtk_image_set_from_pixbuf (GTK_IMAGE (sample_window->priv->image), pixbuf);
 	}
 
+	/* get the pixbuf size */
+	height = gdk_pixbuf_get_height (pixbuf);
+	width = gdk_pixbuf_get_width (pixbuf);
+
 	/* set the pixel array */
 	pixels = gdk_pixbuf_get_pixels (pixbuf);
 	for (i=0; i<width*height*3; i+=3) {



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