[libchamplain] As redraw_scale() is a callback, it should return boolean



commit 7c5bac4c1807dee63d8e398e5b8b9bf3ecfd41ec
Author: JiÅ?í Techet <techet gmail com>
Date:   Sat Feb 26 14:38:22 2011 +0100

    As redraw_scale() is a callback, it should return boolean

 champlain/champlain-scale.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/champlain/champlain-scale.c b/champlain/champlain-scale.c
index 95696a9..5ed2407 100644
--- a/champlain/champlain-scale.c
+++ b/champlain/champlain-scale.c
@@ -225,7 +225,7 @@ champlain_scale_class_init (ChamplainScaleClass *klass)
 }
 
 
-static void
+static gboolean
 redraw_scale (ChamplainScale *scale)
 {
   static gfloat previous_m_per_pixel = 0.0;
@@ -247,8 +247,10 @@ redraw_scale (ChamplainScale *scale)
   gfloat offset;
   ChamplainMapSource *map_source;
 
+  priv->redraw_scheduled = FALSE;
+
   if (!priv->view)
-    return;
+    return FALSE;
 
   zoom_level = champlain_view_get_zoom_level (priv->view);
   map_source = champlain_view_get_map_source (priv->view);
@@ -260,7 +262,7 @@ redraw_scale (ChamplainScale *scale)
    * since at low levels the value changes alot, and not at high levels */
   if (fabs (m_per_pixel - previous_m_per_pixel) < 10 &&
       previous_zoom_level == zoom_level)
-    return;
+    return FALSE;
 
   previous_m_per_pixel = m_per_pixel;
   previous_zoom_level = zoom_level;
@@ -367,7 +369,7 @@ redraw_scale (ChamplainScale *scale)
 
   cairo_destroy (cr);
 
-  priv->redraw_scheduled = FALSE;
+  return FALSE;
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]