-
-
Notifications
You must be signed in to change notification settings - Fork 938
text: Fix x/y scaling of device text glyphs #22209
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
Open
kjarosh
wants to merge
7
commits into
ruffle-rs:master
Choose a base branch
from
kjarosh:edittext-device-transform
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+561
−12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
|
This also fixes #16745! |
e0d59aa to
798f205
Compare
This is needed as this transformation applies device-text specific scaling.
This makes sure that the device-text specific transforms are applied.
Device text requires non-translation-only transformations in the layout_to_local_matrix, which requires the generic inverse() function to be called when calculating its inverse.
Device 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.
Tests basic translations applied to device text.
798f205 to
eaf94dc
Compare
Collaborator
|
With this, #22113 displays this: The text is no longer stretched, but it's not in the right place anymore. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-core
Area: Core player, where no other category fits
device-fonts
Issues related to device fonts. They are usually very system-dependent.
newsworthy
T-compat
Type: Compatibility with Flash Player
text
Issues relating to text rendering/input
waiting-on-review
Waiting on review from a Ruffle team member
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.

MOUSE_OUT->gotoAndStop()causes text to vanish. #15110Device 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: