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

Fix null text alignment returning as CENTER on HashLink #3196

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

Starmapo
Copy link
Contributor

@Starmapo Starmapo commented Jun 30, 2024

While working on the new text input, I found out that when compiling to HashLink, FlxText's align would return CENTER by default (not having changed it manually), instead of LEFT. This seems to be caused by the switch statement in FlxTextAlign.fromOpenFL() treating the null value as a 0, which corresponds to CENTER in OpenFL's text alignment enum (which is an abstract for Int).

This PR simply adds a null check in the function, which makes it automatically return LEFT if a null alignment was passed in.

@Geokureli
Copy link
Member

made an issue for this, here: HaxeFoundation/hashlink#696

@Geokureli Geokureli merged commit 5ee9735 into HaxeFlixel:dev Jul 1, 2024
11 checks passed
@Geokureli
Copy link
Member

Thanks!

@Geokureli Geokureli added this to the 5.9.0 milestone Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants