Mercurial > geeqie
diff src/image.c @ 885:ad420f2eb789
Use a specific enum for image.zoom_mode values (ZoomMode) and
simplify calls to image_zoom_get_default(), dropping last parameter
which was always options->image.zoom_mode.
author | zas_ |
---|---|
date | Tue, 15 Jul 2008 12:52:02 +0000 |
parents | db6977f8b0f1 |
children | d8e1e820cee7 |
line wrap: on
line diff
--- a/src/image.c Sun Jul 13 14:50:07 2008 +0000 +++ b/src/image.c Tue Jul 15 12:52:02 2008 +0000 @@ -1312,29 +1312,21 @@ return g_strdup_printf("%.*f :%s%.*f", pl, l, approx, pr, r); } -gdouble image_zoom_get_default(ImageWindow *imd, gint mode) +gdouble image_zoom_get_default(ImageWindow *imd) { - gdouble zoom; + gdouble zoom = 1.0; - if (mode == ZOOM_RESET_ORIGINAL) - { - zoom = 1.0; - } - else if (mode == ZOOM_RESET_FIT_WINDOW) - { + switch (options->image.zoom_mode) + { + case ZOOM_RESET_ORIGINAL: + break; + case ZOOM_RESET_FIT_WINDOW: zoom = 0.0; - } - else - { - if (imd) - { - zoom = image_zoom_get(imd); - } - else - { - zoom = 1.0; - } - } + break; + case ZOOM_RESET_NONE: + if (imd) zoom = image_zoom_get(imd); + break; + } return zoom; }