Skip to content

clutter/clone: Build scale factor for transformation during allocation

For ClutterClones we need to apply a scale to the texture of the clone to ensure the painted texture of the source actor actually fits the allocation of the clone. We're doing this using the transformation matrix instead of using the scale_x/scale_y properties of ClutterActor to allow users to scale ClutterClones using that API independently.

Now it's quite a bad idea to get the allocation boxes for calculating that scale using clutter_actor_get_allocation_box(), since that method will internally do an immediate relayout of the stage in case the actor isn't allocated. Another side effect of that approach is that it makes it impossible to invalidate the transform (which is needed for the next commit when we start caching those matrices) properly.

So since we eventually allocate both the source actor and the clone ourselves anyway, we can simply use the allocation box inside clutter_clone_allocate() (which is definitely updated and valid at that point) to calculate the scale factor.

Depends on gnome-shell!1119 (merged)

Edited by Jonas Dreßler

Merge request reports