openfl/openfl — pull request #397 by T1mL3arn (2014-11-18 10:16:11+00:00)
Title: Textfield autoSize and wordWrap fixes (for html5-canvas)

About wordWrap
https://github.com/openfl/openfl-html5/issues/17
https://github.com/openfl/openfl/issues/297
About autoSize
http://www.openfl.org/archive/community/programming-haxe/textfield-autosize-center-broken/

And now it is fixed!

Demo project is here https://github.com/T1mL3arn/TextField-fixes-demo

How it looks in Flash

![in flash](https://cloud.githubusercontent.com/assets/9349164/5085046/84495baa-6f59-11e4-9411-0ecb8e8f3c76.PNG)

How fix looks in Opera and Firefox

![opera firefox new code](https://cloud.githubusercontent.com/assets/9349164/5085103/494e8560-6f5a-11e4-808a-7662c26f87c9.PNG)

How it looks without fixes (Firefox throws error, Opera is not)

![opera firefox old code](https://cloud.githubusercontent.com/assets/9349164/5085126/7281d72a-6f5a-11e4-84d0-1807d9a151bc.PNG)

Additionally, in the process of correcting some of the tests have been updated.
And little fix for text field length getter.

There is also a small "glitch" with changing the text for text field with autoSize=RIGHT/CENTER (I made animation in demo project). If i understood, this occurs because html5 uses requestAnimationFrame method. But text field gets right values for width and x, and after next call of requestAnimationFrame the field will be in the right place.