mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-09-18 21:10:00 +00:00
Add gsk_bounding_box_get_corner
This will be used in the following commits.
This commit is contained in:
parent
7cd97192e5
commit
a6d2d983b8
@ -112,4 +112,32 @@ gsk_bounding_box_union (const GskBoundingBox *a,
|
||||
gsk_bounding_box_init (res, &min, &max);
|
||||
}
|
||||
|
||||
G_END_DECLS
|
||||
static inline void
|
||||
gsk_bounding_box_get_corner (const GskBoundingBox *b,
|
||||
GskCorner c,
|
||||
graphene_point_t *p)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case GSK_CORNER_TOP_LEFT:
|
||||
*p = b->min;
|
||||
break;
|
||||
|
||||
case GSK_CORNER_TOP_RIGHT:
|
||||
p->x = b->max.x;
|
||||
p->y = b->min.y;
|
||||
break;
|
||||
|
||||
case GSK_CORNER_BOTTOM_RIGHT:
|
||||
*p = b->max;
|
||||
break;
|
||||
|
||||
case GSK_CORNER_BOTTOM_LEFT:
|
||||
p->x = b->min.x;
|
||||
p->y = b->max.y;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user