From 1f5e879e2fbe484a3e68e944c70e7c787ae9d9ec Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Thu, 7 Feb 2008 15:06:31 +0000 Subject: [PATCH] 2008-02-07 Tomas Frydrych * clutter/clutter-actor.c: (clutter_actor_set_property): Fixed handling of PROP_ROTATE_CENTER_Y, ROTATE_CENTER_Z * tests/test-actors.c: Adjusted to use anchor point for both group and hands. --- ChangeLog | 25 +++++++++++++++++-------- clutter/clutter-actor.c | 4 ++-- tests/test-actors.c | 30 +++++++++++++++++++----------- 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28296e2cc..3d02b8eff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-02-07 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_set_property): + Fixed handling of PROP_ROTATE_CENTER_Y, ROTATE_CENTER_Z + + * tests/test-actors.c: + Adjusted to use anchor point for both group and hands. + 2008-02-07 Neil J. Patel * tests/test-actors.c: (frame_cb), (main): @@ -13,7 +22,7 @@ when looking at the symbols, so we don't load them all up. * clutter/clutter-script.c (resolve_alpha_func): Ditto as above. - + 2008-02-07 Øyvind Kolås * clutter/clutter-actor.c: @@ -57,7 +66,7 @@ 2008-02-06 Matthew Allum * clutter/clutter-texture.c: - Minor clean up from last commit. + Minor clean up from last commit. * tests/test-fbo.c: Small tweak (rotate offscreen, rather than resize) @@ -68,7 +77,7 @@ Initial attempt at handling resizing/tranformed source textures. * clutter/pango/pangoclutter-render.c: (draw_glyph): - Guards against freetype returning NULL bitmaps and + Guards against freetype returning NULL bitmaps and thus causing device by zeros on NVIDIA drivers. (see ml) 2008-02-05 Matthew Allum @@ -137,7 +146,7 @@ Add notify signal for set_rotate * clutter/clutter-texture.c: - Add basic cleanup code for fbo's + Add basic cleanup code for fbo's * tests/test-fbo.c: (main): Minor notes. @@ -207,8 +216,8 @@ Fall back to again not relying on xfixes to hide cursor. *sigh* * clutter/clutter-deprecated.h: - Add clutter_group_find_child_by_id - + Add clutter_group_find_child_by_id + 2008-02-01 Øyvind Kolås * clutter/cogl/gles/cogl.c: (cogl_rectangle_internal): increase size @@ -254,7 +263,7 @@ * (_clutter_actor_apply_modelview_transform_recursive): Made to work for parentless actors. - + 2008-01-31 Øyvind Kolås * tests/test-depth.c: added a box of cloned hands to further expand @@ -318,7 +327,7 @@ * clutter/clutter-actor.c: * clutter/clutter-actor.h: Added new clutter_actor_move_anchor_point_ API. - + * clutter/clutter-behaviour-scale.c: * clutter/clutter-behaviour-scale.h: * clutter/clutter-effect.c: diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 9fe7562e0..2a0d14f47 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -1213,7 +1213,7 @@ clutter_actor_set_property (GObject *object, center = g_value_get_boxed (value); clutter_actor_set_rotationx (actor, - CLUTTER_X_AXIS, + CLUTTER_Y_AXIS, priv->ryang, CLUTTER_UNITS_TO_DEVICE (center->x), 0, @@ -1226,7 +1226,7 @@ clutter_actor_set_property (GObject *object, center = g_value_get_boxed (value); clutter_actor_set_rotationx (actor, - CLUTTER_X_AXIS, + CLUTTER_Z_AXIS, priv->rzang, CLUTTER_UNITS_TO_DEVICE (center->x), CLUTTER_UNITS_TO_DEVICE (center->y), diff --git a/tests/test-actors.c b/tests/test-actors.c index dce707546..a5a109439 100644 --- a/tests/test-actors.c +++ b/tests/test-actors.c @@ -93,12 +93,11 @@ frame_cb (ClutterTimeline *timeline, gint i; /* Rotate everything clockwise about stage center*/ + clutter_actor_set_rotation (CLUTTER_ACTOR (oh->group), CLUTTER_Z_AXIS, frame_num, - CLUTTER_STAGE_WIDTH() / 2, - CLUTTER_STAGE_HEIGHT() / 2, - 0); + 0, 0, 0); for (i = 0; i < n_hands; i++) { @@ -111,9 +110,9 @@ frame_cb (ClutterTimeline *timeline, * * FIXME: scaling causes drift so disabled for now. Need rotation * unit based functions to fix. - */ + */ clutter_actor_set_rotation (oh->hand[i], CLUTTER_Z_AXIS, - - 6.0 * frame_num, 0, 0, 0); + - 6.0 * frame_num, 0, 0, 0); } } @@ -199,18 +198,15 @@ main (int argc, char *argv[]) x = CLUTTER_STAGE_WIDTH () / 2 + radius - * cos (i * M_PI / (n_hands / 2)) - - w / 2; + * cos (i * M_PI / (n_hands / 2)); y = CLUTTER_STAGE_HEIGHT () / 2 + radius - * sin (i * M_PI / (n_hands / 2)) - - h / 2; - - clutter_actor_set_position (oh->hand[i], x, y); + * sin (i * M_PI / (n_hands / 2)); clutter_actor_move_anchor_point_from_gravity (oh->hand[i], CLUTTER_GRAVITY_CENTER); + clutter_actor_set_position (oh->hand[i], x, y); /* Add to our group group */ clutter_container_add_actor (CLUTTER_CONTAINER (oh->group), oh->hand[i]); @@ -225,6 +221,18 @@ main (int argc, char *argv[]) clutter_actor_show_all (oh->group); + clutter_actor_set_anchor_point_from_gravity (oh->group, + CLUTTER_GRAVITY_CENTER); + clutter_actor_set_position (oh->group, + CLUTTER_STAGE_WIDTH()/2, + CLUTTER_STAGE_HEIGHT()/2); + + printf ("group %dx%d, stage %dx%d\n", + clutter_actor_get_width (oh->group), + clutter_actor_get_height (oh->group), + CLUTTER_STAGE_WIDTH(), + CLUTTER_STAGE_HEIGHT()); + /* Add the group to the stage */ clutter_container_add_actor (CLUTTER_CONTAINER (stage), CLUTTER_ACTOR (oh->group));