From dd75320d14ba9bb815ed1d8a352fffde4a12fbf5 Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Mon, 16 Apr 2007 18:45:54 +0000 Subject: [PATCH] Patch by: Erich Schubert 2007-04-16 Jens Granseuer Patch by: Erich Schubert * applier.c: (get_geometry): fix scaling for WPTYPE_ZOOM. Fixes bug #342356. svn path=/trunk/; revision=7473 --- libbackground/ChangeLog | 7 +++++++ libbackground/applier.c | 15 ++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libbackground/ChangeLog b/libbackground/ChangeLog index fa6ab9e6f..c958a0421 100644 --- a/libbackground/ChangeLog +++ b/libbackground/ChangeLog @@ -1,3 +1,10 @@ +2007-04-16 Jens Granseuer + + Patch by: Erich Schubert + + * applier.c: (get_geometry): fix scaling for WPTYPE_ZOOM. Fixes + bug #342356. + 2007-01-08 Rodney Dawes * preferences.c (bg_preferences_merge_entry): diff --git a/libbackground/applier.c b/libbackground/applier.c index 0a4275e87..dcac027c8 100644 --- a/libbackground/applier.c +++ b/libbackground/applier.c @@ -1012,15 +1012,8 @@ get_geometry (wallpaper_type_t wallpaper_type, gint pwidth, pheight; gint st = 0; - if (field_geom->width != virtual_geom->width) - xfactor = (gdouble) field_geom->width / (gdouble) virtual_geom->width; - else - xfactor = 1.0; - - if (field_geom->height != virtual_geom->height) - yfactor = (gdouble) field_geom->height / (gdouble) virtual_geom->height; - else - yfactor = 1.0; + xfactor = (gdouble) field_geom->width / (gdouble) virtual_geom->width; + yfactor = (gdouble) field_geom->height / (gdouble) virtual_geom->height; pwidth = gdk_pixbuf_get_width (pixbuf); pheight = gdk_pixbuf_get_height (pixbuf); @@ -1095,13 +1088,13 @@ get_geometry (wallpaper_type_t wallpaper_type, asp = (gdouble) pwidth / (gdouble) virtual_geom->width; if (asp > (gdouble) pheight / virtual_geom->height) { - src_geom->width = pwidth * virtual_geom->height / pheight; + src_geom->width = pheight * virtual_geom->width / virtual_geom->height; src_geom->height = pheight; src_geom->x = (pwidth - src_geom->width) / 2; src_geom->y = 0; } else { src_geom->width = pwidth; - src_geom->height = pheight * virtual_geom->width / pwidth; + src_geom->height = pwidth * virtual_geom->height / virtual_geom->width; src_geom->x = 0; src_geom->y = (pheight - src_geom->height) / 2; }