Skip to content

core: fix center and right alignment of edit_text#12598

Closed
SuchAFuriousDeath wants to merge 1 commit intoruffle-rs:masterfrom
SuchAFuriousDeath:edit-text
Closed

core: fix center and right alignment of edit_text#12598
SuchAFuriousDeath wants to merge 1 commit intoruffle-rs:masterfrom
SuchAFuriousDeath:edit-text

Conversation

@SuchAFuriousDeath
Copy link
Copy Markdown
Collaborator

@SuchAFuriousDeath SuchAFuriousDeath commented Aug 6, 2023

Fixes #1440 and its minimal reproduction #10660. I'm not really sure why this works, but it doesn't seem to break anything else

@Dinnerbone
Copy link
Copy Markdown
Contributor

Can you please add a test for this? We need more coverage of text stuff <3

@SuchAFuriousDeath
Copy link
Copy Markdown
Collaborator Author

I can try :D

@n0samu
Copy link
Copy Markdown
Member

n0samu commented Aug 8, 2023

This also fixes #3156. 👍

@n0samu
Copy link
Copy Markdown
Member

n0samu commented Aug 18, 2023

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;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Dinnerbone Dinnerbone marked this pull request as draft November 9, 2023 21:55
@danielhjacobs danielhjacobs added A-core Area: Core player, where no other category fits T-fix Type: Bug fix (in something that's supposed to work already) labels Sep 17, 2024
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 T-fix Type: Bug fix (in something that's supposed to work already)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nanaca Crash: Misaligned 'record' numbers

5 participants