Skip to content

clutter-clone: Do not use global transformation for scaling clones

Marco Trevisan requested to merge 3v1n0/mutter:fix-clone-transform into main

When cloning an actor we were applying a global scale to it, based on the size of the clone itself and of the cloned actor.

This implied that the transformed size of the clone was not the one that was set, but it was taking taking in account the actor scaling too. So in practice we were scaling it twice.

While this had no visual implications it indeed was causing troubles when a ClutterClone was reactive because in such case only the scaled area of the scaled clone was considered reactive.

Assume you had an actor of 100x100 pixels, scaling it to a clone of 50x50 pixels:

  • The scale applied to the clone was 0.5
  • The transformed size of the clone was: 25x25 pixels
  • The clone was reactive only in that sub-area

To avoid this, never touch the clone transformation matrix, but only transform it at paint time.

Merge request reports