Skip to content

Parameter input: Fix Vector2 split #173

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

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Parameter input: Fix Vector2 split #173

merged 1 commit into from
Jul 30, 2024

Conversation

manuq
Copy link
Contributor

@manuq manuq commented Jul 30, 2024

If a space is left in the Y axis, the default doesn't work. This fixes a bug where focusing the Y side of a Vector2 input and then losing the focus ends with the " " string in the input, losing the default number.

Follow up of #160

https://phabricator.endlessm.com/T35562

Copy link
Contributor

@wnbaum wnbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also need to add a space after the comma in this line. Otherwise when the script is loaded again, the vector string will not be split properly.

You'll need to update the pong scene as well, since vectors are currently stored like "1,1" without the space.

Another option is just to remove the spaces entirely from the default values to keep the current serialization scheme.

If a space is left in the Y axis, the default doesn't work. This fixes a
bug where focusing the Y side of a Vector2 input and then losing the
focus ends with the " " string in the input, losing the default number.
@manuq manuq force-pushed the fix-vector2-split branch from ddc95e0 to 29dd943 Compare July 30, 2024 19:41
@manuq
Copy link
Contributor Author

manuq commented Jul 30, 2024

Thanks for the insightful review, @wnbaum! As you said, the problem was actually in the defaults having the space character after the comma. Ready for review again.

Copy link
Contributor

@wnbaum wnbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now!

Having the user set properties serialized as a String is kind of weird, I changed this in my decouple PR so that Variants themselves get serialized which hopefully leads to less issues like this.

@wnbaum wnbaum merged commit c6fd7cc into main Jul 30, 2024
2 checks passed
@wnbaum wnbaum deleted the fix-vector2-split branch July 30, 2024 20:18
@dbnicholson
Copy link
Member

Having the user set properties serialized as a String is kind of weird, I changed this in my decouple PR so that Variants themselves get serialized which hopefully leads to less issues like this.

I was thinking the same thing. Let's try to get that in when the dust has settled.

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

Successfully merging this pull request may close these issues.

3 participants