Describe the bug
Consider the following sample: NanacaScoreField.zip. This is a simpler demonstration of #1440.
Here is the AS code:
score_txt.autoSize = "right";
score_txt.text = "999.99";
In Ruffle, it looks like this:

Notice that the score text is cut off.
Expected behavior
Here is how it appears in Flash:

Affected platform
Desktop app
Operating system
Windows 10
Browser
No response
Additional information
The score_txt field is set to right alignment in the Flash editor. The problem persists if the field is set to center alignment, and disappears if the field is set to left alignment. The problem disappears if the AS code that sets autoSize is removed, but persists if autoSize is set to "left", "right", or "center".
I tried adding the following line after
|
// The edit text's bounds needs to have the padding baked in. |
println!("bounds: {:?}\nintrinsic bounds: {:?}", edit_text.bounds, intrinsic_bounds);
According to my understanding of the concept of "intrinsic bounds", they should always start at (0, 0). I noticed that the intrinsic bounds have a nonzero offset_x when there is a problem, whereas offset_x is 0 when Ruffle is working correctly.
Describe the bug
Consider the following sample: NanacaScoreField.zip. This is a simpler demonstration of #1440.
Here is the AS code:
In Ruffle, it looks like this:

Notice that the score text is cut off.
Expected behavior
Here is how it appears in Flash:

Affected platform
Desktop app
Operating system
Windows 10
Browser
No response
Additional information
The score_txt field is set to right alignment in the Flash editor. The problem persists if the field is set to center alignment, and disappears if the field is set to left alignment. The problem disappears if the AS code that sets
autoSizeis removed, but persists ifautoSizeis set to "left", "right", or "center".I tried adding the following line after
ruffle/core/src/display_object/edit_text.rs
Line 730 in aef3ed2
println!("bounds: {:?}\nintrinsic bounds: {:?}", edit_text.bounds, intrinsic_bounds);According to my understanding of the concept of "intrinsic bounds", they should always start at (0, 0). I noticed that the intrinsic bounds have a nonzero
offset_xwhen there is a problem, whereasoffset_xis 0 when Ruffle is working correctly.