diff options
author | Scott Balneaves <[email protected]> | 2013-05-03 15:50:44 -0500 |
---|---|---|
committer | Scott Balneaves <[email protected]> | 2013-05-03 15:50:44 -0500 |
commit | f153fc4ad4a09a31c5df22f67931d052f0a30385 (patch) | |
tree | ef1af0cbc46858db86178ce0c2b791d3cd022461 /capplets | |
parent | e5969608503fd0dbce1951b2ca6ea049584c062a (diff) | |
download | mate-control-center-f153fc4ad4a09a31c5df22f67931d052f0a30385.tar.bz2 mate-control-center-f153fc4ad4a09a31c5df22f67931d052f0a30385.tar.xz |
Begin to work on bug #50
Diffstat (limited to 'capplets')
-rw-r--r-- | capplets/about-me/mate-about-me.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/capplets/about-me/mate-about-me.c b/capplets/about-me/mate-about-me.c index b48cbdee..22bb2f14 100644 --- a/capplets/about-me/mate-about-me.c +++ b/capplets/about-me/mate-about-me.c @@ -138,7 +138,8 @@ about_me_update_photo (MateAboutMe *me) GdkPixbuf *pixbuf = NULL, *scaled = NULL; int height, width; gboolean do_scale = FALSE; - float scale; + float scale = 1.0; + float scalex = 1.0, scaley = 1.0; e_image_chooser_get_image_data (E_IMAGE_CHOOSER (me->image_chooser), (char **) &data, &length); @@ -158,11 +159,18 @@ about_me_update_photo (MateAboutMe *me) height = gdk_pixbuf_get_height (pixbuf); width = gdk_pixbuf_get_width (pixbuf); - if (height >= width && height > MAX_HEIGHT) { - scale = (float)MAX_HEIGHT/height; + if (width > MAX_WIDTH) { + scalex = (float)MAX_WIDTH/width; + if (scalex < scale) { + scale = scalex; + } do_scale = TRUE; - } else if (width > height && width > MAX_WIDTH) { - scale = (float)MAX_WIDTH/width; + } + if (height > MAX_HEIGHT) { + scaley = (float)MAX_HEIGHT/height; + if (scaley < scale) { + scale = scaley; + } do_scale = TRUE; } |