feat: add transform-skew-x/y support - #12660
Open
NLazyCat wants to merge 7 commits into
Open
Conversation
Add skew transform properties to Slint, enabling CSS-like skew/oblique transforms on any element. - Add transform_skew_x/y properties to Transform item - Add skew() method to ItemRenderer trait - Implement skew in Skia renderer (canvas.skew + euclid pre_skew) - Implement skew in FemtoVG renderer (skew_x/skew_y + clip recomputation) - Add stub in Software renderer (tracked in slint-ui#6068) - Register transform-skew-x/y in compiler (typeregister, builtins, lowering) - Compose skew into children_transform for coordinate mapping - Add screenshot tests (3/3 passing: software, software_embed_assets, skia)
- Add skew() to Qt renderer using QTransform::shear - Import num_traits::Float in item_tree.rs for no_std compatibility
Member
|
Thanks for the PR. What is the use case for this feature? |
Author
|
I'm doing a mechanical migration of a WinUI3 component library to Slint. WinUI3 has SkewTransform (AngleX/AngleY) and CompositeTransform (which includes SkewX/SkewY) — Slint currently has no equivalent for these, so transform-skew-x/y is needed to unblock the migration path. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add transform-skew-x and transform-skew-y properties to Slint, enabling CSS-like skew/oblique transforms on any element.
Closes the missing SkewTransform from the WinUI → Slint mapping.
Changes:
Usage:
Rectangle {
transform-skew-x: 20deg;
transform-skew-y: -10deg;
}
Testing: