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

Implement Transformation::stretch, Transformation::inverse and the safer Transformation::try_inverse #2766

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

airstrike
Copy link
Contributor

Transformation::stretch seems like a non-issue since it's just scaling across a single axis. Useful for custom widgets that want to scale in that fashion, such as anything with a timeline: DAWs, video editors, charts...

While we're on the topic of Transformation, it can incredibly handy to be able to invert some previous complex transformation so we can go to-and-from different coordinate systems, so I think it would be helpful to add some inversion method. After iterating for a bit, I am still not sure about the API for inverse and try_inverse.

I have tests to add if you think it would be helpful.

@airstrike
Copy link
Contributor Author

airstrike commented Jan 30, 2025

@edwloef was kind enough to point out that Transformation::scale_factor needs to account for the possibility of non-uniform scaling transformations. I've changed its return type to (f32, f32) and worked through the compiler errors.

It's looking good, but I want to do some more testing, likely by modifying the custom_quad example to help visualize it.

I just don't really have the time to wrap this up this week so I'll have to come back to it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant