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 jsdoc in setWordWrapWidth from Text and TextStyle #6813

Conversation

AlbertMontagutCasero
Copy link
Contributor

This PR

  • Updates the JSDocumentation
  • Fixes a bug

Describe the changes below:

I was using typescript phaser version when I found an issue with Phaser.GameObjects.Text.setWordWrapWidth, the method description says: params width - The maximum width of a line in pixels. Set to null to remove wrapping.

So I tried to set it to null.
image

But the following typescript error appeared. That's because the method jsdoc don't allow passing null, just undefined.
Reading the source code, I found that null is the correct value to pass here.

This PR changes the jsdoc to allow passing null to the method without errors.

I didn't generate the .d.ts definitions with npm run tsgen, which is something I think should be done by the maintainers of the project when new releases of the project are generated. Please do it after these changes.

I hope it helps, have a nice day!

@photonstorm photonstorm merged commit 27a0cb1 into phaserjs:master Jun 6, 2024
@photonstorm
Copy link
Collaborator

👍

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.

2 participants