summaryrefslogtreecommitdiff
path: root/components/image-viewer
diff options
context:
space:
mode:
authorAndy Hertzfeld <andy@src.gnome.org>2000-12-01 02:10:50 +0000
committerAndy Hertzfeld <andy@src.gnome.org>2000-12-01 02:10:50 +0000
commita14aaa5bae1735f663c9c9b34ee5d8e29a5153c5 (patch)
treebb38d73b1b5198cc36ba7037e29f48e8c6200b04 /components/image-viewer
parentf67f74c5d10c1e7ef06690cffc230767cac96134 (diff)
downloadnautilus-a14aaa5bae1735f663c9c9b34ee5d8e29a5153c5.tar.gz
fixed bug in image viewer where zooming in skipped a level if you were
* components/image-viewer/nautilus-image-view.c: (zoomable_zoom_in_callback): fixed bug in image viewer where zooming in skipped a level if you were zoomed to fit. Fixed by only incrementing the index if we're already at the current level.
Diffstat (limited to 'components/image-viewer')
-rw-r--r--components/image-viewer/nautilus-image-view.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/components/image-viewer/nautilus-image-view.c b/components/image-viewer/nautilus-image-view.c
index 9c033ff87..3ca6780a1 100644
--- a/components/image-viewer/nautilus-image-view.c
+++ b/components/image-viewer/nautilus-image-view.c
@@ -288,7 +288,7 @@ zoom_level_from_index (int index)
static void
zoomable_zoom_in_callback (BonoboZoomable *zoomable, bonobo_object_data_t *bod)
{
- float new_zoom_level;
+ float this_zoom_level, new_zoom_level;
int index;
g_return_if_fail (bod != NULL);
@@ -297,9 +297,18 @@ zoomable_zoom_in_callback (BonoboZoomable *zoomable, bonobo_object_data_t *bod)
if (index == max_preferred_zoom_levels)
return;
- index++;
- new_zoom_level = zoom_level_from_index (index);
-
+ /* if we were zoomed to fit, we're not on one of the pre-defined level.
+ * We want to zoom into the next real level instead of skipping it
+ */
+ this_zoom_level = zoom_level_from_index (index);
+
+ if (this_zoom_level > bod->zoom_level) {
+ new_zoom_level = this_zoom_level;
+ } else {
+ index++;
+ new_zoom_level = zoom_level_from_index (index);
+ }
+
gtk_signal_emit_by_name (GTK_OBJECT (zoomable), "set_zoom_level",
new_zoom_level);
}