Skip to content

Allow calculating resource scales in more situations

Allow calculating the resource scale of an actor while the actor is not mapped or during the actor is in a size negotiation using get_preferred_width/height().

This is needed for ClutterText, which uses the resource scale inside it's get_preferred_width/height, allocate and paint implementations.

This also fixes a crash where a ClutterClone tries to paint an unmapped actor with a ClutterOffscreenEffect. The clone temporarily maps the actor, but not its parent, and the offscreen effect requests the actors resource scale. Now ClutterActor might go up the actor hierarchy to get the resource scale but the parent is unmapped so it returns FALSE. This means the offscreen effects assertion of the resource scale being valid fails, causing a crash. In this case we now return a valid resource scale because ClutterClone still expects cloned actors to be realized, so in the worst case we'll just return the scale of the stage.

Fixes: #808 (closed)

Merge request reports