summaryrefslogtreecommitdiff
path: root/gsk/gskpath.c
diff options
context:
space:
mode:
Diffstat (limited to 'gsk/gskpath.c')
-rw-r--r--gsk/gskpath.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gsk/gskpath.c b/gsk/gskpath.c
index 1ff80f05a4..0762ceab1e 100644
--- a/gsk/gskpath.c
+++ b/gsk/gskpath.c
@@ -1269,6 +1269,28 @@ gsk_path_reverse (GskPath *self)
}
/**
+ * gsk_path_is_convex:
+ * @self: a `GskPath`
+ *
+ * Returns information about whether this path is convex.
+ *
+ * A path with more than one contour is never convex.
+ *
+ * Returns: `TRUE` if @self is convex
+ */
+gboolean
+gsk_path_is_convex (GskPath *self)
+{
+ if (self->n_contours == 0)
+ return TRUE;
+
+ if (self->n_contours > 1)
+ return FALSE;
+
+ return gsk_contour_is_convex (gsk_path_get_contour (self, 0));
+}
+
+/**
* gsk_path_stroke:
* @self: a `GskPath`
* @stroke: stroke parameters