From 411aea0b6760885fb0948343c3a2900287dd1489 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Mon, 19 Nov 2007 20:48:58 +0000 Subject: Fix scaling issues svn path=/branches/iains-blingtastic-bucket-o-bling/; revision=3418 --- src/screen.c | 16 +++++++++++++--- 1 file 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; -- cgit v1.2.1