mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 13:24:09 +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,
|
ClutterVertex *vertices_out,
|
||||||
int n_vertices);
|
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,
|
void _clutter_util_rectangle_union (const cairo_rectangle_int_t *src1,
|
||||||
const cairo_rectangle_int_t *src2,
|
const cairo_rectangle_int_t *src2,
|
||||||
cairo_rectangle_int_t *dest);
|
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 >
|
/*< private >
|
||||||
* _clutter_util_rectangle_union:
|
* _clutter_util_rectangle_union:
|
||||||
* @src1: first rectangle to union
|
* @src1: first rectangle to union
|
||||||
|
Loading…
x
Reference in New Issue
Block a user