mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
clutter/util: Add function to build a ClutterRect from a cairo rectangle
Utility functions to easily convert a cairo rectangle into a ClutterRect. And add ability to offset a cairo rect. https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
This commit is contained in:
parent
3512647419
commit
789a3ef029
@ -241,6 +241,9 @@ void _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
ClutterVertex *vertices_out,
|
||||
int n_vertices);
|
||||
|
||||
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
ClutterRect *dest);
|
||||
|
||||
void _clutter_util_rectangle_union (const cairo_rectangle_int_t *src1,
|
||||
const cairo_rectangle_int_t *src2,
|
||||
cairo_rectangle_int_t *dest);
|
||||
|
@ -105,6 +105,21 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
}
|
||||
}
|
||||
|
||||
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
ClutterRect *dest)
|
||||
{
|
||||
*dest = (ClutterRect) {
|
||||
.origin = {
|
||||
.x = src->x,
|
||||
.y = src->y
|
||||
},
|
||||
.size = {
|
||||
.width = src->width,
|
||||
.height = src->height
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* _clutter_util_rectangle_union:
|
||||
* @src1: first rectangle to union
|
||||
|
Loading…
Reference in New Issue
Block a user