CCLabelTTF: alignment error on Android

Hi,

when we display a text in a CCLabelTTF that is wider than the label width, the sentence is wrapped. On Android, however, the wrapped sentences indent to the right (s. screenshot).
Is this a bug or a feature?

We are using version cocos2d-2.1rc0-x-2.1.2 and we tried it on a Galaxy Tab and on the latest Kindle Fire.

Kristiaan.


SC20130416-103010.png (210.2 KB)

After a bit of code digging I found out that the problem is in Cocos2dxBitmap.java where a sentence with spaces is wrapped if possible after a word and before the space. The space is then the first character of the following line, which causes the indent.

K.

The problem is in Cocos2dxBitmap.java lines 298-300

while (pString.indexOf(i) == ' ') {
    ++i;
}   

This should be changed to

while (pString.charAt(i) == ' ') {
    ++i;
}   

K.

Yep, you are right.
Thank you.