aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-zoom.c
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-10-08 23:58:48 +0800
committerXan Lopez <xan@igalia.com>2012-10-08 23:58:48 +0800
commit3ee22bbfc7953fe5912f516a647244a56505a252 (patch)
tree6b7488de925b6bbe8114125f9a5f501e934970de /lib/ephy-zoom.c
parente628032b0988ddb8cd3c922943c53e6ee65ec824 (diff)
downloadgsoc2013-epiphany-3ee22bbfc7953fe5912f516a647244a56505a252.tar
gsoc2013-epiphany-3ee22bbfc7953fe5912f516a647244a56505a252.tar.gz
gsoc2013-epiphany-3ee22bbfc7953fe5912f516a647244a56505a252.tar.bz2
gsoc2013-epiphany-3ee22bbfc7953fe5912f516a647244a56505a252.tar.lz
gsoc2013-epiphany-3ee22bbfc7953fe5912f516a647244a56505a252.tar.xz
gsoc2013-epiphany-3ee22bbfc7953fe5912f516a647244a56505a252.tar.zst
gsoc2013-epiphany-3ee22bbfc7953fe5912f516a647244a56505a252.zip
ephy-zoom: use new coding style
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);
}