[libchamplain] Add champlain_polygon_remote_point



commit f2fb54846069d163a8ec1758184eb6859c3ec2d9
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date:   Tue Jul 28 23:24:09 2009 -0400

    Add champlain_polygon_remote_point

 champlain/champlain-polygon.c |   19 +++++++++++++++++++
 champlain/champlain-polygon.h |    2 ++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
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
@@ -353,6 +353,25 @@ champlain_polygon_insert_point (ChamplainPolygon *self,
 }
 
 /**
+ * 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);
 



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