CCLabelTTF incorrectly splits up an incoming string with newline characters
CCLabelTTF incorrectly splits up an incoming string with newline characters
Bug #3689 [Closed]
This is on version 2.2.2 (can’t seem to change the header information in this tool after submission)
Hi, Alan
Can you post your code to create the label and its configurations?
Thank you
Huabin
- Status changed from New to In Progress
- Assignee set to pandamicro
- Target version set to v3.0 alpha
I have reproduced the bug, thanks for your report!
Huabin
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
Fixed in this pull request : https://github.com/pandamicro/cocos2d-html5/compare/develop?expand=1
Status: | Closed | |
---|---|---|
Start date: | 2014-01-14 | |
Priority: | Low | |
Due date: | ||
Assignee: | ||
% Done: | 100% |
|
Category: | - | |
Target version: | v3.0 alpha |
The following text is incorrectly split by CCLabelTTF when it attempts to detect chinese characters
“email is invalid.↵password is too short (minimum is 6 characters).↵”
The second portion of the string (after the first newline) is kept intact when it should be split up (just before the characters word) when using a field of 310px with a 16pt armata font.
Commenting out the code from lines 132 to 149 restores the behaviour from the previous SDKs. The line in particular which is triggered that causes the whole second portion to not be split up is at 134 (the last re.exec sets result[2] to the newline character)
For now as I do not use chinese characters I will keep the code commented out but a universal solution would be great
Thanks