fix: clipping behavior of children with transform #635
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the logic that's used to define the clipping of children relative to their parent element so that they render correctly when the parent has
overflow: hidden
and the child has atransform
property. The new logic does the following:clip-path
and amask
to the shape/image element, as that will be handled outside this elementtransform
attribute if the overflow is hidden and there is a transform definitionAlso added unit tests for the behavior. All the previously defined tests pass. To my knowledge and based on my manual tests, these changes don't break existing behavior.
Before:
After:
Playground example: https://og-playground.vercel.app/?share=5VTBTsMwDP2VyKdNKlrZNJAi4MYPII69pIvbhmVJlKTrpqr_TrKIrR3jCBd6qe1nJ37vSelhozkChScu9oUixPmjxOe-jzEhXDgj2ZGSAiqJhwKyWB-GQr3E4GvoeuynwfgZ7YQXWkWIlU7L1uMI9tpQsszPucTKTwqd4L6hZJVfSg2Kugldq_WlVrLNtra6VTxe1DVicoveo62k7iLWCM5RncFIjpATvTHB7xRvrnJ7met1qnbTOMFGCwXililXabuLDW6L3WyZc6znCZDM4-wxN4csaGEO88loqS1H-8a4aN1Eq8SFkEVyaxHYhOhPnVuPxPlt626JeJdU_Ef2pj9koE10ywHt4UQF6H0euECiAPQhJhzLtgbqbYsZ4E5_iPejiQ-C705ZOKfSyr_uSuSpbcjAszJ0NCiDD9pKDsMn
Fixes #481