[HTML5] Twitchy autoformatted text

There is a small rendering problem of texts with TextFieldAutoSize.RIGHT and TextFieldAutoSize.CENTER and set defaultTextFormat. Sometimes they shift to the right for several milliseconds after being modified.

Does openfl test html5 -Dopenfl-always-render look the same, or a little different?

Looks the same. ````

Can you slow it down, does it stay shifted after it first increases in width (such as 9 to 10) and stay that way until the next update?

Would you mind sharing a little bit of sample code, if it isn’t too hard?

Thanks :slight_smile:

Speed or text size doesn’t seem to matter. At least, a string which always consists of 1 symbol behaves the same for me (randomly twitching after the symbol is changed).

The code looks like generic text field code.

var tf:TextField = new TextField();
tf.autoSize = TextFieldAutoSize.RIGHT;//or TextFieldAutoSize.CENTER
tf.antiAliasType = AntiAliasType.ADVANCED;
tf.embedFonts = true;
tf.defaultTextFormat = new TextFormat("Verdana", 24, 0xFFFFFF);
tf.x = tf.y = 500;
tf.width = 0;//changing to another value doesn't fix the case
tf.height = 0;
tf.mouseEnabled = false;
tf.visible = true;
sprStage.addChild(tf);//sprStage is the main game sprite

HTML5, or desktop? If HTML5, what browser?


HTML5, all browsers.

Maybe I was wrong about this. It’s better to test when the text width changes.