[libchamplain] Fix bug where champlain_view_center_on() didn't work properly



commit 0bad7657f68c6effe85c6538970a246073bda40d
Author: JiÅ?í Techet <techet gmail com>
Date:   Fri Mar 12 21:28:29 2010 +0100

    Fix bug where champlain_view_center_on() didn't work properly
    
    champlain_view_center_on() didn't update priv->viewport_size.x and
    priv->viewport_size.y, which caused that not all necessary tiles were
    loaded by view_load_visible_tiles() because it uses the viewport
    coordinates from priv->viewport_size
    
    Signed-off-by: JiÅ?í Techet <techet gmail com>

 champlain/champlain-view.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 5a25611..19bf72d 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -1779,12 +1779,12 @@ champlain_view_center_on (ChamplainView *view,
 
   view_update_anchor (view, x, y);
 
-  x -= priv->anchor.x;
-  y -= priv->anchor.y;
+  priv->viewport_size.x = x - priv->anchor.x - priv->viewport_size.width / 2.0;
+  priv->viewport_size.y = y - priv->anchor.y - priv->viewport_size.height / 2.0;
 
   tidy_viewport_set_origin (TIDY_VIEWPORT (priv->viewport),
-    x - priv->viewport_size.width / 2.0,
-    y - priv->viewport_size.height / 2.0,
+    priv->viewport_size.x,
+    priv->viewport_size.y,
     0);
 
   g_object_notify (G_OBJECT (view), "longitude");



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