]> err.no Git - libchamplain/commitdiff
Fix Polygon displaying with zoom levels requiring an anchor
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sat, 12 Sep 2009 21:47:31 +0000 (17:47 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sat, 12 Sep 2009 21:47:31 +0000 (17:47 -0400)
champlain/champlain-view.c

index 6356bde7cdab719661c5c1933428fb9e6ab688a1..9477a9e59c4520596312136ef290e7cc952e5623 100644 (file)
@@ -402,15 +402,15 @@ draw_polygon (ChamplainView *view, ChamplainPolygon *polygon)
   while (list != NULL)
     {
       ChamplainPoint *point = (ChamplainPoint*) list->data;
-      gint x, y;
+      gfloat x, y;
 
       x = champlain_map_source_get_x (priv->map_source, priv->zoom_level,
           point->lon);
       y = champlain_map_source_get_y (priv->map_source, priv->zoom_level,
           point->lat);
 
-      x -= priv->viewport_size.x;
-      y -= priv->viewport_size.y;
+      x -= priv->viewport_size.x + priv->anchor.x;
+      y -= priv->viewport_size.y + priv->anchor.y;
 
       cairo_line_to (cr, x, y);
       list = list->next;
@@ -2543,7 +2543,7 @@ view_update_polygons (ChamplainView *view)
 {
   ChamplainViewPrivate *priv = view->priv;
   GList *polygons;
-  gint x, y;
+  gfloat x, y;
 
   if (priv->polygons == NULL)
     return;