mirror of
https://github.com/brl/mutter.git
synced 2025-04-29 05:09:39 +00:00
actor: Reset the content box when setting a new content
We want to recompute the content box when changing the content instance, in case the preferred size is different and the content gravity uses the preferred size; the change of content with different preferred size and same gravity should also trigger an implicit transition. https://bugzilla.gnome.org/show_bug.cgi?id=711182
This commit is contained in:
parent
1e2132eca4
commit
d546c0c121
@ -19606,8 +19606,26 @@ clutter_actor_set_content (ClutterActor *self,
|
|||||||
* do.
|
* do.
|
||||||
*/
|
*/
|
||||||
if (priv->content_gravity != CLUTTER_CONTENT_GRAVITY_RESIZE_FILL)
|
if (priv->content_gravity != CLUTTER_CONTENT_GRAVITY_RESIZE_FILL)
|
||||||
|
{
|
||||||
|
if (priv->content_box_valid)
|
||||||
|
{
|
||||||
|
ClutterActorBox from_box, to_box;
|
||||||
|
|
||||||
|
clutter_actor_get_content_box (self, &from_box);
|
||||||
|
|
||||||
|
/* invalidate the cached content box */
|
||||||
|
priv->content_box_valid = FALSE;
|
||||||
|
clutter_actor_get_content_box (self, &to_box);
|
||||||
|
|
||||||
|
if (!clutter_actor_box_equal (&from_box, &to_box))
|
||||||
|
_clutter_actor_create_transition (self, obj_props[PROP_CONTENT_BOX],
|
||||||
|
&from_box,
|
||||||
|
&to_box);
|
||||||
|
}
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_CONTENT_BOX]);
|
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_CONTENT_BOX]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_get_content:
|
* clutter_actor_get_content:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user