Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextField change autoSize bug in Starling 2.0 #820

Closed
Maligan opened this issue Mar 24, 2016 · 4 comments
Closed

TextField change autoSize bug in Starling 2.0 #820

Maligan opened this issue Mar 24, 2016 · 4 comments
Labels

Comments

@Maligan
Copy link

Maligan commented Mar 24, 2016

Hi Daniel, again!

I continue my code diving into amazing Starling 2.0 text engine code, and find interesting bug:
Values of _meshBatch.x / _meshBatch.y is changed within updateText() method, if used auto sizing.
But if text field doesn't use auto size _meshBatch position doesn't reset to zero.

You can catch missing text with next code:

var textFiled:TextField = new TextField(200, 200, "Hello World");
textFiled.border = true;
textFiled.autoSize = TextFieldAutoSize.HORIZONTAL;

// Use timeout - textField must be composed once
setTimeout(function():void
{
    textFiled.autoSize = TextFieldAutoSize.NONE
}, 1000);

After one second - you gain empty text filed, because _meshBatch has bad position

@PrimaryFeather
Copy link
Contributor

A very good find, thanks a lot! I fixed that right away. 😄

@Maligan
Copy link
Author

Maligan commented Mar 25, 2016

Oops... This is not enough :-)

What about reset position only in one dimension?
For example, if it changes from BOTH to HORIZONTAL

@PrimaryFeather
Copy link
Contributor

Oh my, yes, I see what you mean. Ooops! 😉
I'll provide a fix asap.

@PrimaryFeather
Copy link
Contributor

This time, it's just always reset to 0, 0 before doing anything with it. That should do it. Thanks again! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants