1
0
Fork 0

mtk/rectangle: Add constructor for an empty rectangle

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3703>
This commit is contained in:
Jonas Ådahl 2024-03-25 10:38:04 +01:00 committed by Marge Bot
parent 1f82365021
commit 3091449298
2 changed files with 9 additions and 0 deletions

View file

@ -65,6 +65,12 @@ mtk_rectangle_new (int x,
return rect;
}
MtkRectangle *
mtk_rectangle_new_empty (void)
{
return g_new0 (MtkRectangle, 1);
}
/**
* mtk_rectangle_area:
* @rect: A rectangle

View file

@ -86,6 +86,9 @@ MtkRectangle * mtk_rectangle_new (int x,
int width,
int height);
MTK_EXPORT
MtkRectangle * mtk_rectangle_new_empty (void);
/* Basic comparison functions */
MTK_EXPORT
int mtk_rectangle_area (const MtkRectangle *rect);