From 118b74e95c3ed0c258154f0f5c61dc1e6dccab53 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 20 Jan 2015 13:55:39 +0800 Subject: [PATCH] update uiTextBMFont setFontFile --- cocos/ui/UITextBMFont.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cocos/ui/UITextBMFont.cpp b/cocos/ui/UITextBMFont.cpp index 6395264d08..19c768da25 100644 --- a/cocos/ui/UITextBMFont.cpp +++ b/cocos/ui/UITextBMFont.cpp @@ -89,15 +89,16 @@ void TextBMFont::setFntFile(const std::string& fileName) _labelBMFontRenderer->setBMFontFilePath(fileName); _fntFileHasInit = true; - setString(_stringValue); + updateContentSizeWithTextureSize(_labelBMFontRenderer->getContentSize()); + _labelBMFontRendererAdaptDirty = true; } void TextBMFont::setString(const std::string& value) { - //if (value == _labelBMFontRenderer->getString()) - //{ - // return; - //} + if (value == _labelBMFontRenderer->getString()) + { + return; + } _stringValue = value; if (!_fntFileHasInit) {