Skip to content
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

Transform primitive #2120

Merged
merged 9 commits into from
Feb 2, 2024
Merged

Transform primitive #2120

merged 9 commits into from
Feb 2, 2024

Conversation

hecrj
Copy link
Member

@hecrj hecrj commented Oct 23, 2023

This PR replaces the Translate primitive in iced_graphics with a more generic Transform primitive that can take any non-skewing affine Transformation (i.e. scaling and translation).

Additionally, a transform method has been implemented for Geometry in iced_renderer. This enables efficient translation and scaling of cached geometry with a canvas::Cache, since transform can be called on the returned cached geometry!

But not only that, this new primitive can be used to effectively scale any part of the UI. This can be very useful for building node-based editors, for instance.

There are still some quirks to iron out here. Mainly, scaling text does not work currently, but that should be fairly easy to fix.

@hecrj hecrj added this to the 0.12 milestone Oct 23, 2023
@hecrj hecrj force-pushed the transform-primitive branch from 3748dd7 to 17c3d57 Compare October 24, 2023 00:46
@0x7CFE
Copy link
Contributor

0x7CFE commented Oct 24, 2023

I wrote a feedback with a few notable issues on the iced Discourse.

@alex13sh
Copy link

What about the rotation method?

@hecrj hecrj force-pushed the transform-primitive branch from 6505051 to d8dffa4 Compare February 2, 2024 01:32
@hecrj hecrj enabled auto-merge February 2, 2024 13:46
@hecrj hecrj merged commit aea1725 into master Feb 2, 2024
26 checks passed
@hecrj hecrj deleted the transform-primitive branch February 2, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants