From: Pierre-Luc Beaudoin Date: Wed, 29 Jul 2009 03:24:09 +0000 (-0400) Subject: Add champlain_polygon_remote_point X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2fb54846069d163a8ec1758184eb6859c3ec2d9;p=libchamplain Add champlain_polygon_remote_point --- diff --git a/champlain/champlain-polygon.c b/champlain/champlain-polygon.c index c592c8d..1bdcd6d 100644 --- a/champlain/champlain-polygon.c +++ b/champlain/champlain-polygon.c @@ -352,6 +352,25 @@ champlain_polygon_insert_point (ChamplainPolygon *self, return point; } +/** + * champlain_polygon_remove_point: + * @polygon: The polygon + * @point: the #ChamplainPoint to remove + * + * Removes the point from the polygon. + * + * Since: 0.4 + */ +void +champlain_polygon_remove_point (ChamplainPolygon *self, + ChamplainPoint *point) +{ + g_return_if_fail (CHAMPLAIN_IS_POLYGON (self)); + + self->priv->points = g_list_remove (self->priv->points, point); + g_object_notify (G_OBJECT (self), "visible"); +} + /** * champlain_polygon_clear_points: * @polygon: The polygon diff --git a/champlain/champlain-polygon.h b/champlain/champlain-polygon.h index 8671bfa..e68fb1c 100644 --- a/champlain/champlain-polygon.h +++ b/champlain/champlain-polygon.h @@ -69,6 +69,8 @@ ChamplainPoint * champlain_polygon_insert_point (ChamplainPolygon *polygon, gdouble lat, gdouble lon, gint pos); +void champlain_polygon_remove_point (ChamplainPolygon *self, + ChamplainPoint *point); void champlain_polygon_clear_points (ChamplainPolygon *polygon); GList *champlain_polygon_get_points (ChamplainPolygon *polygon);