-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to rotate items and their children #1481
Comments
Regarding the origin, i wonder if it would not be better to have, instead of
Maybe something like one property of type point:
One day if we add tuple to the langage, we could even shorten it to Edit: Should the default not be (50%,50%) anyway? |
Maybe it is also better in the first release to limit rotation to This would solve the issue with translating input events. Image rotation is the primary use case for this feature anyway. |
Yes. I think this would apply to quite a few places where we have
I've been thinking that this is something that we could perhaps implement generically in the compiler. We maintain to have individual If for some reason that's a little too "magic" then we could at least annotate these kind of property groups where we allow that in builtins.slint, for example for all the
Yes!! |
For the record, that's fine with me :) |
- Add a check that this only Applies to Image element without children - Default the origin to the center of the Image - Add docs and test cc: #1481
- Add a check that this only Applies to Image element without children - Default the origin to the center of the Image - Add docs and test cc: #1481
- Add a check that this only Applies to Image element without children - Default the origin to the center of the Image - Add docs and test cc: #1481
Now it is implemented and documented but it only work on childless Images. |
I would like to see this for text. But also for arbitrary widgets since it will be a requirement on Android and iOS. |
Actually a specific use I have right now for text is to rotate to label a Y axis in a graph. |
I would like to see the progress bar rotatable, as the above has stated labels on other axis is another use case |
@maciek134 yes, that's correct. The blocker I'd say is event handling that needs to understand the rotation. I think that feature would not be useful without that. Or what are you trying to do? I'd be happy to review PR, thanks for that. I think we could merge any PR that does any of the following:
Regarding the software renderer, one tricky part will also be to compute dirty regions. In addition to support image rotating, and drawing of rotated (rounded) rectangle. |
This works with Skia, Qt, and FemtoVG. cc #1481
This works with Skia, Qt, and FemtoVG. cc #1481
The ability to rotate Text element that don't have children is implemented now for FemtVG/Skia/Qt (as part of #5532). |
Thanks @ogoffart , makes sense. In that case I'll start with arbitrary element rotation with input and follow with the software renderer implementation later - the math for dirty region calculation should have a lot of overlap with event handling. |
For certain types of UIs - like for example a compass - we need the ability to rotate an item and its children. #1478 revives some old code to bring back this feature as:
properties on any items, resulting in an injected hidden
Rotate
element that applies the rotation when rendering.Commit 7b50e38 implements the rotation also for the Skia backend.
There are a few things left before this issue can be considered complete:
The text was updated successfully, but these errors were encountered: