summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2012-11-29 18:36:10 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2012-11-30 18:13:53 -0500
commit15b811840c81a990ff0d09eba05952fd34277c63 (patch)
tree7d2d933c194b876db2d19df90b0d8b77f379b657
parent75b521de6e3294bb612f08b1f191b0f75778d828 (diff)
downloadclutter-15b811840c81a990ff0d09eba05952fd34277c63.tar.gz
actor: Use fixed positioning for allocate_preferred_size
clutter_actor_allocate_preferred_size is supposed to use the fixed position of an actor. Unfortunately, recent refactorings made it so that it accidentally used the current allocation. As the current allocation may be adjusted by the actor, or have been previously allocated in a strange spot, it may have unintended side effects. Use the fixed positioning of the actor instead. This fixes weird issues with margins colliding with ClutterFixedLayout, causing strange offsets on relayout. https://bugzilla.gnome.org/show_bug.cgi?id=689316
-rw-r--r--clutter/clutter-actor.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 2f24de0dc..55861bb80 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -15097,11 +15097,24 @@ clutter_actor_allocate_preferred_size (ClutterActor *self,
gfloat actor_x, actor_y;
gfloat natural_width, natural_height;
ClutterActorBox actor_box;
+ ClutterActorPrivate *priv;
+ const ClutterLayoutInfo *info;
g_return_if_fail (CLUTTER_IS_ACTOR (self));
- actor_x = clutter_actor_get_x (self);
- actor_y = clutter_actor_get_y (self);
+ priv = self->priv;
+
+ if (priv->position_set)
+ {
+ info = _clutter_actor_get_layout_info_or_defaults (self);
+ actor_x = info->fixed_pos.x;
+ actor_y = info->fixed_pos.y;
+ }
+ else
+ {
+ actor_x = 0;
+ actor_y = 0;
+ }
clutter_actor_get_preferred_size (self,
NULL, NULL,