mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
clutter/paint-volume: Add new API to convert to graphene_box_t
Will be used to cull when picking based on the actor's projected paint volume. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1520>
This commit is contained in:
parent
c3534d3390
commit
1fdde25b3e
@ -133,6 +133,9 @@ void _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolu
|
||||
void _clutter_paint_volume_transform_relative (ClutterPaintVolume *pv,
|
||||
ClutterActor *relative_to_ancestor);
|
||||
|
||||
void clutter_paint_volume_to_box (ClutterPaintVolume *pv,
|
||||
graphene_box_t *box);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_PAINT_VOLUME_PRIVATE_H__ */
|
||||
|
@ -1131,3 +1131,25 @@ _clutter_paint_volume_transform_relative (ClutterPaintVolume *pv,
|
||||
|
||||
_clutter_paint_volume_transform (pv, &matrix);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_paint_volume_to_box (ClutterPaintVolume *pv,
|
||||
graphene_box_t *box)
|
||||
{
|
||||
int vertex_count;
|
||||
|
||||
if (pv->is_empty)
|
||||
{
|
||||
graphene_box_init_from_box (box, graphene_box_empty ());
|
||||
return;
|
||||
}
|
||||
|
||||
_clutter_paint_volume_complete (pv);
|
||||
|
||||
if (G_LIKELY (pv->is_2d))
|
||||
vertex_count = 4;
|
||||
else
|
||||
vertex_count = 8;
|
||||
|
||||
graphene_box_init_from_points (box, vertex_count, pv->vertices);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user