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:
Tomas Frydrych
2008-02-15 09:40:41 +00:00
parent 4d53cb1037
commit 78341d2e28
4 changed files with 73 additions and 46 deletions

View File

@ -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