From f2fb54846069d163a8ec1758184eb6859c3ec2d9 Mon Sep 17 00:00:00 2001 From: Pierre-Luc Beaudoin Date: Tue, 28 Jul 2009 23:24:09 -0400 Subject: [PATCH] Add champlain_polygon_remote_point --- champlain/champlain-polygon.c | 19 +++++++++++++++++++ champlain/champlain-polygon.h | 2 ++ 2 files changed, 21 insertions(+) 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); -- 2.39.5