]> err.no Git - libchamplain/commitdiff
Add champlain_polygon_remote_point
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Wed, 29 Jul 2009 03:24:09 +0000 (23:24 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Wed, 29 Jul 2009 03:24:09 +0000 (23:24 -0400)
champlain/champlain-polygon.c
champlain/champlain-polygon.h

index c592c8d308abc037db2cb64e583e8f88b1d32d86..1bdcd6d79d045edc58f3f78e1de26211ec187f61 100644 (file)
@@ -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
index 8671bfaae02690b50c44026966136ce4b7d2c1e3..e68fb1c35e9be82d31914587c03d554b3e047cb0 100644 (file)
@@ -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);