mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 17:27:03 -05:00
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
This commit is contained in:
parent
75b521de6e
commit
15b811840c
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user