aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-05-31 22:36:51 +0800
committerChristian Persch <chpe@src.gnome.org>2005-05-31 22:36:51 +0800
commit65d72dadd8762f9d86c2a1f28a4af0c8dc784973 (patch)
tree1194ed95470fb750128f364aff0c58224a0906e0 /lib
parent30457fd1bc79dfc4e2fc36a165de0abf1b1d5b77 (diff)
downloadgsoc2013-epiphany-65d72dadd8762f9d86c2a1f28a4af0c8dc784973.tar
gsoc2013-epiphany-65d72dadd8762f9d86c2a1f28a4af0c8dc784973.tar.gz
gsoc2013-epiphany-65d72dadd8762f9d86c2a1f28a4af0c8dc784973.tar.bz2
gsoc2013-epiphany-65d72dadd8762f9d86c2a1f28a4af0c8dc784973.tar.lz
gsoc2013-epiphany-65d72dadd8762f9d86c2a1f28a4af0c8dc784973.tar.xz
gsoc2013-epiphany-65d72dadd8762f9d86c2a1f28a4af0c8dc784973.tar.zst
gsoc2013-epiphany-65d72dadd8762f9d86c2a1f28a4af0c8dc784973.zip
Add scroll event listener, and change zoom on scroll+wheel events.
2005-05-31 Christian Persch <chpe@cvs.gnome.org> * data/default-prefs-common.js: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: Add scroll event listener, and change zoom on scroll+wheel events. * lib/ephy-zoom.c: (ephy_zoom_get_changed_zoom_level): * lib/ephy-zoom.h: Fix signed/unsigned integer problems (underflow).
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-zoom.c8
-rw-r--r--lib/ephy-zoom.h5
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/ephy-zoom.c b/lib/ephy-zoom.c
index b6cf8c68b..00fd34aae 100644
--- a/lib/ephy-zoom.c
+++ b/lib/ephy-zoom.c
@@ -24,7 +24,7 @@
#include <math.h>
-guint
+int
ephy_zoom_get_zoom_level_index (float level)
{
guint i;
@@ -47,12 +47,12 @@ ephy_zoom_get_zoom_level_index (float level)
float
-ephy_zoom_get_changed_zoom_level (float level, gint steps)
+ephy_zoom_get_changed_zoom_level (float level, int steps)
{
- guint index;
+ int index;
index = ephy_zoom_get_zoom_level_index (level);
- return zoom_levels[CLAMP(index + steps, 0, n_zoom_levels - 1)].level;
+ return zoom_levels[CLAMP(index + steps, 0, (int) n_zoom_levels - 1)].level;
}
float ephy_zoom_get_nearest_zoom_level (float level)
diff --git a/lib/ephy-zoom.h b/lib/ephy-zoom.h
index a6853eeae..b8491329c 100644
--- a/lib/ephy-zoom.h
+++ b/lib/ephy-zoom.h
@@ -55,9 +55,10 @@ static const guint n_zoom_levels = G_N_ELEMENTS (zoom_levels);
#define ZOOM_IN (-1.0)
#define ZOOM_OUT (-2.0)
-guint ephy_zoom_get_zoom_level_index (float level);
+int ephy_zoom_get_zoom_level_index (float level);
-float ephy_zoom_get_changed_zoom_level (float level, gint steps);
+float ephy_zoom_get_changed_zoom_level (float level,
+ int steps);
float ephy_zoom_get_nearest_zoom_level (float level);