diff --git a/cocos2dx/label_nodes/CCLabelBMFont.cpp b/cocos2dx/label_nodes/CCLabelBMFont.cpp index 2bbe45067a..929210abc3 100644 --- a/cocos2dx/label_nodes/CCLabelBMFont.cpp +++ b/cocos2dx/label_nodes/CCLabelBMFont.cpp @@ -442,18 +442,18 @@ namespace cocos2d{ CCSize tmpSize = CCSizeZero; int longestLine = 0; - int totalHeight = 0; + unsigned int totalHeight = 0; - int quantityOfLines = 1; + unsigned int quantityOfLines = 1; - int len = m_sString.length(); + unsigned int stringLen = m_sString.length(); - if (0 == len) + if (0 == stringLen) { return; } - for (int i = 0; i < len - 1; ++i) + for (unsigned int i = 0; i < stringLen - 1; ++i) { unsigned short c = m_sString[i]; if (c == '\n') @@ -463,9 +463,9 @@ namespace cocos2d{ } totalHeight = m_pConfiguration->m_uCommonHeight * quantityOfLines; - nextFontPositionY = m_pConfiguration->m_uCommonHeight * (quantityOfLines - 1); + nextFontPositionY = -(m_pConfiguration->m_uCommonHeight - m_pConfiguration->m_uCommonHeight * quantityOfLines); - for(int i=0; iinitWithBatchNode(this, rect); + fontChar->initWithBatchNodeRectInPixels(this, rect); this->addChild(fontChar, 0, i); fontChar->release(); } diff --git a/tests/Res/fonts/tuffy_bold_italic-charmap-hd.png.REMOVED.git-id b/tests/Res/fonts/tuffy_bold_italic-charmap-hd.png.REMOVED.git-id new file mode 100644 index 0000000000..5696ae5bfc --- /dev/null +++ b/tests/Res/fonts/tuffy_bold_italic-charmap-hd.png.REMOVED.git-id @@ -0,0 +1 @@ +8167faf6c40ffd95a03028f1dcee1abdaa48b222 \ No newline at end of file