aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-zoom.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ephy-zoom.c')
-rw-r--r--lib/ephy-zoom.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/lib/ephy-zoom.c b/lib/ephy-zoom.c
index 4cfe8c915..be44217d0 100644
--- a/lib/ephy-zoom.c
+++ b/lib/ephy-zoom.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Copyright © 2003 Christian Persch
*
@@ -18,7 +19,6 @@
*/
#include "config.h"
-
#include "ephy-zoom.h"
#include <math.h>
@@ -26,36 +26,35 @@
int
ephy_zoom_get_zoom_level_index (float level)
{
- guint i;
- float previous, current, mean;
+ guint i;
+ float previous, current, mean;
- previous = zoom_levels[0].level;
+ previous = zoom_levels[0].level;
- for (i = 1; i < n_zoom_levels; i++)
- {
- current = zoom_levels[i].level;
- mean = sqrt (previous * current);
+ for (i = 1; i < n_zoom_levels; i++) {
+ current = zoom_levels[i].level;
+ mean = sqrt (previous * current);
- if (level <= mean) return i - 1;
+ if (level <= mean) return i - 1;
- previous = current;
- }
+ previous = current;
+ }
- return n_zoom_levels - 1;
+ return n_zoom_levels - 1;
}
float
ephy_zoom_get_changed_zoom_level (float level, int steps)
{
- int index;
+ int index;
- index = ephy_zoom_get_zoom_level_index (level);
- return zoom_levels[CLAMP(index + steps, 0, (int) n_zoom_levels - 1)].level;
+ index = ephy_zoom_get_zoom_level_index (level);
+ return zoom_levels[CLAMP(index + steps, 0, (int) n_zoom_levels - 1)].level;
}
float
ephy_zoom_get_nearest_zoom_level (float level)
{
- return ephy_zoom_get_changed_zoom_level (level, 0);
+ return ephy_zoom_get_changed_zoom_level (level, 0);
}