From b51efbd6544d20100cf7d658aa2580a2d61e9a7b Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 31 Dec 2013 14:13:26 +0800 Subject: [PATCH] fix align text error in label --- cocos/2d/CCLabelTextFormatter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp index 7967c6a80d..7c95dc8b13 100644 --- a/cocos/2d/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -240,10 +240,10 @@ bool LabelTextFormatter::alignText(LabelTextFormatProtocol *theLabel) continue; } int index = static_cast(i + lineLength - 1 + lineNumber); + if(currentChar == 0) + index -= 1; if (index < 0) continue; - if(currentChar == 0) - continue; LetterInfo* info = &leterInfo->at( index ); if(info->def.validDefinition == false) continue;