From 06fd56f3591b9b54a2d2a7187194bc15a2dacd4e Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Mon, 19 Nov 2007 21:19:01 +0000 Subject: Make the scale size 150 px svn path=/branches/iains-blingtastic-bucket-o-bling/; revision=3419 --- src/screen.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/screen.c b/src/screen.c index a6fe675b..d0033ecb 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1230,6 +1230,8 @@ meta_screen_update_cursor (MetaScreen *screen) XFreeCursor (screen->display->xdisplay, xcursor); } +#define MAX_PREVIEW_SIZE 150.0 + static GdkPixbuf * get_window_pixbuf (MetaWindow *window) { @@ -1251,17 +1253,17 @@ get_window_pixbuf (MetaWindow *window) width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); - /* Scale pixbuf to max width 100 */ + /* Scale pixbuf to max dimension MAX_PREVIEW_SIZE */ if (width > height) { - ratio = ((double) width) / 100.0; - width = 100; + ratio = ((double) width) / MAX_PREVIEW_SIZE; + width = (int) MAX_PREVIEW_SIZE; height = (int) (((double) height) / ratio); } else { - ratio = ((double) height) / 100.0; - height = 100; + ratio = ((double) height) / MAX_PREVIEW_SIZE; + height = (int) MAX_PREVIEW_SIZE; width = (int) (((double) width) / ratio); } -- cgit v1.2.1