clutter/actor: Remove rotation center

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
This commit is contained in:
Georges Basile Stavracas Neto
2020-06-26 18:39:14 -03:00
committed by Robert Mader
parent 2e086c74e7
commit dc4cb562b7
6 changed files with 25 additions and 478 deletions

View File

@ -126,12 +126,7 @@ frame_cb (ClutterTimeline *timeline,
/* Rotate everything clockwise about stage center*/
if (oh->group != NULL)
clutter_actor_set_rotation (oh->group,
CLUTTER_Z_AXIS,
rotation,
oh->stage_width / 2,
oh->stage_height / 2,
0);
clutter_actor_set_rotation_angle (oh->group, CLUTTER_Z_AXIS, rotation);
for (i = 0; i < n_hands; i++)
{
@ -139,10 +134,9 @@ frame_cb (ClutterTimeline *timeline,
* to take into account any scaling.
*/
if (oh->hand[i] != NULL)
clutter_actor_set_rotation (oh->hand[i],
CLUTTER_Z_AXIS,
-6.0 * rotation,
0, 0, 0);
clutter_actor_set_rotation_angle (oh->hand[i],
CLUTTER_Z_AXIS,
-6.0 * rotation);
}
}
@ -205,6 +199,7 @@ test_actors_main (int argc, char *argv[])
/* create a new actor to hold other actors */
oh->group = clutter_actor_new ();
clutter_actor_set_pivot_point (oh->group, 0.5, 0.5);
clutter_actor_set_layout_manager (oh->group, clutter_fixed_layout_new ());
clutter_actor_set_name (oh->group, "Group");
g_signal_connect (oh->group, "destroy", G_CALLBACK (on_group_destroy), oh);

View File

@ -157,6 +157,7 @@ make_flower_actor (void)
"width", (gfloat) size,
"height", (gfloat) size,
NULL);
clutter_actor_set_pivot_point (ctex, 0.5, 0.5);
g_object_unref (canvas);
@ -182,12 +183,9 @@ tick (ClutterTimeline *timeline,
clutter_actor_set_position (flowers[i]->ctex,
flowers[i]->x, flowers[i]->y);
clutter_actor_set_rotation (flowers[i]->ctex,
CLUTTER_Z_AXIS,
flowers[i]->rot,
clutter_actor_get_width (flowers[i]->ctex)/2,
clutter_actor_get_height (flowers[i]->ctex)/2,
0);
clutter_actor_set_rotation_angle (flowers[i]->ctex,
CLUTTER_Z_AXIS,
flowers[i]->rot);
}
}

View File

@ -117,22 +117,18 @@ frame_cb (ClutterTimeline *timeline,
/* Rotate everything clockwise about stage center*/
clutter_actor_set_rotation (oh->group,
CLUTTER_Z_AXIS,
rotation,
oh->stage_width / 2,
oh->stage_height / 2,
0);
clutter_actor_set_rotation_angle (oh->group,
CLUTTER_Z_AXIS,
rotation);
for (i = 0; i < n_hands; i++)
{
/* Rotate each hand around there centers - to get this we need
* to take into account any scaling.
*/
clutter_actor_set_rotation (oh->hand[i],
CLUTTER_Z_AXIS,
-6.0 * rotation,
0, 0, 0);
clutter_actor_set_rotation_angle (oh->hand[i],
CLUTTER_Z_AXIS,
-6.0 * rotation);
}
}
@ -264,6 +260,7 @@ test_paint_wrapper_main (int argc, char *argv[])
/* create a new group to hold multiple actors in a group */
oh->group = clutter_actor_new();
clutter_actor_set_pivot_point (oh->group, 0.5, 0.5);
oh->hand = g_new (ClutterActor*, n_hands);