diff options
author | Pierre-Luc Beaudoin <pierre-luc@pierlux.com> | 2010-01-28 20:09:35 -0500 |
---|---|---|
committer | Pierre-Luc Beaudoin <pierre-luc@pierlux.com> | 2010-01-28 20:09:35 -0500 |
commit | ef14ca5f7448366dde169f3648e6b0ce4dc21b25 (patch) | |
tree | 29a14114c614804b346ac1b83732f1d734af3282 | |
parent | 29b97b51d40ee609704ea35d778c622487eb1705 (diff) | |
download | libchamplain-ef14ca5f7448366dde169f3648e6b0ce4dc21b25.tar.gz |
do not emit a notify for lat and lon if the change is too smallLIBCHAMPLAIN_0_4_4
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | champlain/champlain-view.c | 15 |
2 files changed, 13 insertions, 4 deletions
@@ -24,6 +24,8 @@ Fixes: Beaudoin) * 606393: The display of tiles looks very programmatic, they now load in spiral order (Jason Woofenden) +* Limit the number of times notify::latitude and notify::longitude are emited + (Pierre-Luc Beaudoin) libchamplain 0.4.3 (2010-01-09) =============================== diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c index b019f47..9e7e2d8 100644 --- a/champlain/champlain-view.c +++ b/champlain/champlain-view.c @@ -285,6 +285,7 @@ update_viewport (ChamplainView *view, gfloat y) { ChamplainViewPrivate *priv = view->priv; + gfloat lat, lon; ChamplainFloatPoint old_anchor; @@ -317,11 +318,17 @@ update_viewport (ChamplainView *view, update_scale (view); view_update_polygons (view); - priv->longitude = viewport_get_current_longitude (priv); - priv->latitude = viewport_get_current_latitude (priv); + lon = viewport_get_current_longitude (priv); + lat = viewport_get_current_latitude (priv); - g_object_notify (G_OBJECT (view), "longitude"); - g_object_notify (G_OBJECT (view), "latitude"); + priv->longitude = lon; + priv->latitude = lat; + + if (fabs (priv->longitude - lon) > 0.001) + g_object_notify (G_OBJECT (view), "longitude"); + + if (fabs (priv->latitude - lat) > 0.001) + g_object_notify (G_OBJECT (view), "latitude"); } static void |