text: Fix x/y scaling of device text glyphs #22209
Open
+561
−12
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.
getCharBoundariesfor scrolled text #22208Device text in FP cannot be scaled independently in x/y. Only the y scale is applied, and the x scale is set so that the aspect ratio of characters is preserved. It's used only for calculating metrics and sizing bounds.
This PR contains a bunch of patches that bring us closer to FP's behavior. We're still not perfect, especially related to measurements, but the good news is that it's a mess in Flash Player too, just a different one.
The main issue with dependent x/y scaling is that measurements operate in unscaled coordinate space, meaning that we have to emulate the size of the unscaled glyphs. If
scaleX/scaleY == 0.5, we have to act as if glyphs were twice as wide.After this PR Ruffle still behaves differently, especially related to: