aboutsummaryrefslogtreecommitdiffstats
path: root/src/gmisc/gmisc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gmisc/gmisc.h')
-rw-r--r--src/gmisc/gmisc.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gmisc/gmisc.h b/src/gmisc/gmisc.h
index c8b4c21f..f805345c 100644
--- a/src/gmisc/gmisc.h
+++ b/src/gmisc/gmisc.h
@@ -464,6 +464,25 @@ extern "C" {
#endif
#endif
+
+#if GMISC_NEED_HITTEST_POLY || defined(__DOXYGEN__)
+ /**
+ * @brief Check whether a point is inside or on the edge of a polygon
+ * @pre Requires GFX_USE_GMISC and GMISC_NEED_HITTEST_POLY
+ *
+ * @note This function works both with convex and concave polygons
+ *
+ * @param[in] pntarray The array of points that form the polygon
+ * @param[in] cnt The number of points in the point array @pntarray
+ * @param[in] p The point to test
+ *
+ * @return @p TRUE if the point @p p is inside or on the edge of the polygon @p pntarray, @p FALSE otherwise.
+ *
+ * @api
+ */
+ bool_t gmiscHittestPoly(const point *pntarray, unsigned cnt, const point *p);
+#endif // GMISC_NEED_HITTEST_POLY
+
#ifdef __cplusplus
}
#endif