Mercurial > dwindows
comparison gtk3/dw.c @ 1426:dfd9f177c34c
Fix incorrect pixbuf scaling on GTK3 when -1 is passed as a parameter
to dw_box_pack*() and the item is a bitmap button.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 03 Dec 2011 09:11:44 +0000 |
parents | 38c4484f5b90 |
children | fbaec6e5df63 |
comparison
equal
deleted
inserted
replaced
1425:1628bf383893 | 1426:dfd9f177c34c |
---|---|
8291 | 8291 |
8292 if(pixbuf) | 8292 if(pixbuf) |
8293 { | 8293 { |
8294 int pwidth = gdk_pixbuf_get_width(pixbuf); | 8294 int pwidth = gdk_pixbuf_get_width(pixbuf); |
8295 int pheight = gdk_pixbuf_get_height(pixbuf); | 8295 int pheight = gdk_pixbuf_get_height(pixbuf); |
8296 | |
8297 if(width == -1) | |
8298 width = pwidth; | |
8299 if(height == -1) | |
8300 height = pheight; | |
8296 | 8301 |
8297 if(pwidth > width || pheight > height) | 8302 if(pwidth > width || pheight > height) |
8298 { | |
8299 pixbuf = gdk_pixbuf_scale_simple(pixbuf, pwidth > width ? width : pwidth, pheight > height ? height : pheight, GDK_INTERP_BILINEAR); | 8303 pixbuf = gdk_pixbuf_scale_simple(pixbuf, pwidth > width ? width : pwidth, pheight > height ? height : pheight, GDK_INTERP_BILINEAR); |
8300 gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf); | 8304 gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf); |
8301 } | |
8302 } | 8305 } |
8303 } | 8306 } |
8304 | 8307 |
8305 tmpitem = (GtkWidget *)g_object_get_data(G_OBJECT(item), "_dw_boxhandle"); | 8308 tmpitem = (GtkWidget *)g_object_get_data(G_OBJECT(item), "_dw_boxhandle"); |
8306 | 8309 |