From: Pierre-Luc Beaudoin Date: Sat, 12 Sep 2009 21:47:31 +0000 (-0400) Subject: Fix Polygon displaying with zoom levels requiring an anchor X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a88e9a2195c76a131fe29ef974d7d4ba26a9f91;p=libchamplain Fix Polygon displaying with zoom levels requiring an anchor --- diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c index 6356bde..9477a9e 100644 --- a/champlain/champlain-view.c +++ b/champlain/champlain-view.c @@ -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;