diff --git a/mtk/mtk/mtk-rectangle.c b/mtk/mtk/mtk-rectangle.c index 3c837af8c..404d407a1 100644 --- a/mtk/mtk/mtk-rectangle.c +++ b/mtk/mtk/mtk-rectangle.c @@ -297,6 +297,22 @@ gboolean mtk_rectangle_contains_point (const MtkRectangle *rect, int x, int y) +{ + return mtk_rectangle_contains_pointf (rect, x, y); +} + +/** + * mtk_rectangle_contains_pointf: + * @rect: A rectangle + * @x: X coordinate of the point + * @y: Y coordinate of the point + * + * Returns: Whether the rectangle contains the point + */ +gboolean +mtk_rectangle_contains_pointf (const MtkRectangle *rect, + float x, + float y) { return (x >= rect->x && x < (rect->x + rect->width) && diff --git a/mtk/mtk/mtk-rectangle.h b/mtk/mtk/mtk-rectangle.h index 02fee6e3e..57076eb92 100644 --- a/mtk/mtk/mtk-rectangle.h +++ b/mtk/mtk/mtk-rectangle.h @@ -131,6 +131,10 @@ MTK_EXPORT gboolean mtk_rectangle_contains_point (const MtkRectangle *rect, int x, int y); +MTK_EXPORT +gboolean mtk_rectangle_contains_pointf (const MtkRectangle *rect, + float x, + float y); MTK_EXPORT graphene_rect_t mtk_rectangle_to_graphene_rect (const MtkRectangle *rect);