-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
apply the inverse scale factor using the transform in UI text extraction #9457
base: main
Are you sure you want to change the base?
apply the inverse scale factor using the transform in UI text extraction #9457
Conversation
Scale the transform by the inverse scale factor, Instead of applying it to the position and atlas coordinates of each individual glyph.
Example |
Is this effectively reverting #8197? It seems like it reintroduces the bug that was fixing. |
Oh you are right, this doesn't work the text is still distorted when clipped. I must have been on the wrong branch or something when I tested it earlier, I was thinking that the other changes since #8197 must have fixed the clipping.
|
…d multiply the individual coordinates for clipped text.
Avoids any problems now by only applying the scaling to the transform when text is unclipped. |
Example |
An alternative is that we could scale the texture rects and atlas size stored in the texture atlas. It would simplify extraction but seems like a hack though. |
Example |
Can you run a new set of benchmarks quick? It sounds like we've introduced a branch since that last one. |
Objective
bevy_ui::extract_text_uinodes
multiplies the position and atlas coordinates of each glyph by the inverse scale factor. It would be more efficient to apply the scaling directly to the text node's transform.Solution
Scale the transform by the inverse scale factor instead.
Changelog
bevy_ui::extract_text_uinodes
:The text node's transform is scaled by the inverse scale factor, instead of multiplying the positions and atlas coordinates of each individual glyph.