2008-02-15 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c: * clutter/clutter-actor.h: (clutter_group_query_coords): Added function to translate vertex array to a bounding box. (clutter_actor_is_scaled): (clutter_actor_is_rotated): Fixed documentation.
This commit is contained in:
@ -148,49 +148,6 @@ clutter_group_request_coords (ClutterActor *self,
|
||||
CLUTTER_ACTOR_CLASS (clutter_group_parent_class)->request_coords (self, box);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_group_get_box_from_vertices (ClutterActorBox *box,
|
||||
ClutterVertex vtx[4])
|
||||
{
|
||||
ClutterUnit x1, x2, y1, y2;
|
||||
|
||||
/* 4-way min/max */
|
||||
x1 = vtx[0].x;
|
||||
y1 = vtx[0].y;
|
||||
if (vtx[1].x < x1)
|
||||
x1 = vtx[1].x;
|
||||
if (vtx[2].x < x1)
|
||||
x1 = vtx[2].x;
|
||||
if (vtx[3].x < x1)
|
||||
x1 = vtx[3].x;
|
||||
if (vtx[1].y < y1)
|
||||
y1 = vtx[1].y;
|
||||
if (vtx[2].y < y1)
|
||||
y1 = vtx[2].y;
|
||||
if (vtx[3].y < y1)
|
||||
y1 = vtx[3].y;
|
||||
|
||||
x2 = vtx[0].x;
|
||||
y2 = vtx[0].y;
|
||||
if (vtx[1].x > x2)
|
||||
x2 = vtx[1].x;
|
||||
if (vtx[2].x > x2)
|
||||
x2 = vtx[2].x;
|
||||
if (vtx[3].x > x2)
|
||||
x2 = vtx[3].x;
|
||||
if (vtx[1].y > y2)
|
||||
y2 = vtx[1].y;
|
||||
if (vtx[2].y > y2)
|
||||
y2 = vtx[2].y;
|
||||
if (vtx[3].y > y2)
|
||||
y2 = vtx[3].y;
|
||||
|
||||
box->x1 = x1;
|
||||
box->x2 = x2;
|
||||
box->y1 = y1;
|
||||
box->y2 = y2;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_group_query_coords (ClutterActor *self,
|
||||
ClutterActorBox *box)
|
||||
@ -220,7 +177,7 @@ clutter_group_query_coords (ClutterActor *self,
|
||||
ClutterVertex vtx[4];
|
||||
|
||||
clutter_actor_get_relative_vertices (child, self, vtx);
|
||||
clutter_group_get_box_from_vertices (&cbox, vtx);
|
||||
clutter_actor_get_box_from_vertices (vtx, &cbox);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user