mirror of https://github.com/axmolengine/axmol.git
fix for spaces when wrapping
This commit is contained in:
parent
6a32986e2e
commit
81e4178a42
|
@ -282,7 +282,7 @@ public class Cocos2dxBitmap {
|
||||||
if (lastIndexOfSpace != -1 && lastIndexOfSpace > start) {
|
if (lastIndexOfSpace != -1 && lastIndexOfSpace > start) {
|
||||||
/* Should wrap the word. */
|
/* Should wrap the word. */
|
||||||
strList.add(pString.substring(start, lastIndexOfSpace));
|
strList.add(pString.substring(start, lastIndexOfSpace));
|
||||||
i = lastIndexOfSpace;
|
i = lastIndexOfSpace + 1; // skip space
|
||||||
} else {
|
} else {
|
||||||
/* Should not exceed the width. */
|
/* Should not exceed the width. */
|
||||||
if (tempWidth > pMaxWidth) {
|
if (tempWidth > pMaxWidth) {
|
||||||
|
@ -295,7 +295,7 @@ public class Cocos2dxBitmap {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove spaces at the beginning of a new line. */
|
/* Remove spaces at the beginning of a new line. */
|
||||||
while (pString.indexOf(i) == ' ') {
|
while (pString.charAt(i) == ' ') {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue