-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
In nodes RichTextLabel and Label, get_total_character_count() now has a parameter to include or not spaces #52712
Conversation
Commits need to be squashed: https://docs.godotengine.org/en/stable/community/contributing/pr_workflow.html#the-interactive-rebase |
ec3338d
to
d20a65f
Compare
doc/classes/RichTextLabel.xml
Outdated
<description> | ||
Returns the total number of characters from text tags. Does not include BBCodes. | ||
If [code]include_spaces[/code] is set to [code]false[/code], it doesn't count spaces. | ||
It's value is true by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
e54d04a
to
43d97ad
Compare
43d97ad
to
6d74a21
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is fine, but I do not see why this is useful to have.
Not counting spaces in the 3.x Label
is probably a bug.
In fact, it doesn't look useful to add this new parameter. The reason I did it was because it shouldn't count spaces, accordingly to the previous documentation, but it was counting. It would be simpler to just fix the documentation, but maybe there are some places where this function was used supposing it is counting spaces and some places where it isn't. Is it better to just fix the documentation? But yeah, definitely a PR in the 3.x would be way more clear that it is fixing a bug. Can I do this already? I read that all fixes should be done first in master branch. |
So it seems that there is no need to change anything in the |
The default value of this new parameter is true.
This was made mainly because the behavior of the function was inconsistent with the description in the documentation.
Fixes #27896.