ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

avm2: Set EditText width during creation

Open SuchAFuriousDeath opened this issue 1 month ago • 1 comments

Fixes #12490.

I do not fully understand this tbh and not sure if this is the correct fix.

What happens is that the game tries to cache movie clips using bitmaps and without this fix the bounds of the movieclip are absolutely massive, resulting in a bitmap so big that it is invalid. (The width of the TextEdit is set to the default 1 000 000 from the createTextLine method signature: https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html#createTextLine().

I expect that this will need a test, but I do not want to waste time on this before it is vibe-checked by someone who has a proper understanding of this code area.

SuchAFuriousDeath avatar Nov 30 '25 01:11 SuchAFuriousDeath

The tests fail, so this does seem quite correct. It should be noted that the doc for the width parameters says 'Specifies the desired width of the line in pixels. The actual width may be less. '. Maybe the right solution is some sort of compromise?

SuchAFuriousDeath avatar Nov 30 '25 01:11 SuchAFuriousDeath