summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2007-11-19 20:48:58 +0000
committerIain Holmes <iain@src.gnome.org>2007-11-19 20:48:58 +0000
commit411aea0b6760885fb0948343c3a2900287dd1489 (patch)
tree24e4d13e11d3222bc8559b2c0d2dc807bde355c6
parentf69f8a4b1fa6172798c007797445a6e9947a589b (diff)
downloadmetacity-411aea0b6760885fb0948343c3a2900287dd1489.tar.gz
Fix scaling issues
svn path=/branches/iains-blingtastic-bucket-o-bling/; revision=3418
-rw-r--r--src/screen.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/screen.c b/src/screen.c
index 89f7d123..a6fe675b 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1252,10 +1252,20 @@ get_window_pixbuf (MetaWindow *window)
height = gdk_pixbuf_get_height (pixbuf);
/* Scale pixbuf to max width 100 */
- ratio = ((double) width) / 100.0;
+ if (width > height)
+ {
+ ratio = ((double) width) / 100.0;
+ width = 100;
+ height = (int) (((double) height) / ratio);
+ }
+ else
+ {
+ ratio = ((double) height) / 100.0;
+ height = 100;
+ width = (int) (((double) width) / ratio);
+ }
- scaled = gdk_pixbuf_scale_simple (pixbuf, 100,
- (int)(((double)height) / ratio),
+ scaled = gdk_pixbuf_scale_simple (pixbuf, width, height,
GDK_INTERP_BILINEAR);
g_object_unref (pixbuf);
return scaled;