Mercurial > dwindows
changeset 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 | 1628bf383893 |
children | 7b735226ab94 |
files | gtk3/dw.c |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/gtk3/dw.c Sat Dec 03 04:40:35 2011 +0000 +++ b/gtk3/dw.c Sat Dec 03 09:11:44 2011 +0000 @@ -8293,12 +8293,15 @@ { int pwidth = gdk_pixbuf_get_width(pixbuf); int pheight = gdk_pixbuf_get_height(pixbuf); + + if(width == -1) + width = pwidth; + if(height == -1) + height = pheight; if(pwidth > width || pheight > height) - { pixbuf = gdk_pixbuf_scale_simple(pixbuf, pwidth > width ? width : pwidth, pheight > height ? height : pheight, GDK_INTERP_BILINEAR); - gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf); - } + gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf); } }