core: fix center and right alignment of edit_text#12598
Closed
SuchAFuriousDeath wants to merge 1 commit intoruffle-rs:masterfrom
Closed
core: fix center and right alignment of edit_text#12598SuchAFuriousDeath wants to merge 1 commit intoruffle-rs:masterfrom
SuchAFuriousDeath wants to merge 1 commit intoruffle-rs:masterfrom
Conversation
Contributor
|
Can you please add a test for this? We need more coverage of text stuff <3 |
Collaborator
Author
|
I can try :D |
Member
|
This also fixes #3156. 👍 |
e4b5861 to
d455d23
Compare
Member
|
After testing this a bit more thoroughly, I realized that this breaks the sizing of text outlines, and only fixes the positioning of right-aligned text, not centered text. See #10660 (comment) |
| if !is_word_wrap { | ||
| // The edit text's bounds needs to have the padding baked in. | ||
| let width = intrinsic_bounds.width() + padding; | ||
| let width = intrinsic_bounds.extent_x() + padding; |
Collaborator
There was a problem hiding this comment.
Based on nosamu's tests, this seems wrong. I have no experience in this part of Ruffle, but this seems like it's just adding padding to fix right alignment, and it breaks center alignment.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1440 and its minimal reproduction #10660. I'm not really sure why this works, but it doesn't seem to break anything else