[libchamplain] Fix blocked panning bug



commit 4f9a1d8bdb724daa5cbee818c29f84c2686b2723
Author: JiÅ?í Techet <techet gmail com>
Date:   Fri Mar 12 00:06:56 2010 +0100

    Fix blocked panning bug
    
    The detection of anchor update was done incorrectly in the case when
    panning down (i.e. going to the north)
    
    Signed-off-by: JiÅ?í Techet <techet gmail com>

 champlain/champlain-view.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 3c6cea1..fbc8e0e 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -1708,11 +1708,12 @@ view_update_anchor (ChamplainView *view,
   if (priv->zoom_level >= 8)
     need_anchor = TRUE;
 
+  /* update anchor one viewport size before reaching the margin to be sure */
   if (priv->anchor_zoom_level != priv->zoom_level ||
-      x - priv->anchor.x + priv->viewport_size.width >= G_MAXINT16 ||
-      y - priv->anchor.y + priv->viewport_size.height >= G_MAXINT16 ||
-      x - priv->anchor.x + priv->viewport_size.width <= 0 ||
-      y - priv->anchor.y + priv->viewport_size.height <= 0 )
+      x - priv->anchor.x - priv->viewport_size.width / 2 >= G_MAXINT16 - 2 * priv->viewport_size.width ||
+      y - priv->anchor.y - priv->viewport_size.height / 2 >= G_MAXINT16 - 2 * priv->viewport_size.height ||
+      x - priv->anchor.x - priv->viewport_size.width / 2 <= 0 + priv->viewport_size.width ||
+      y - priv->anchor.y - priv->viewport_size.height / 2 <= 0 + priv->viewport_size.height )
     need_update = TRUE;
 
   if (need_anchor && need_update)



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