Skip to content

Commit d005bd1

Browse files
LiamLiam
Liam
authored and
Liam
committed
remove error logic
1 parent 434c79a commit d005bd1

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

cocos/ui/UITextBMFont.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ IMPLEMENT_CLASS_GUI_INFO(TextBMFont)
3636

3737
TextBMFont::TextBMFont():
3838
_labelBMFontRenderer(nullptr),
39-
_fntFileHasInit(false),
4039
_fntFileName(""),
4140
_stringValue(""),
4241
_labelBMFontRendererAdaptDirty(true)
@@ -89,7 +88,6 @@ void TextBMFont::setFntFile(const std::string& fileName)
8988
_fntFileName = fileName;
9089
_labelBMFontRenderer->setBMFontFilePath(fileName);
9190

92-
_fntFileHasInit = true;
9391
updateContentSizeWithTextureSize(_labelBMFontRenderer->getContentSize());
9492
_labelBMFontRendererAdaptDirty = true;
9593
}
@@ -102,10 +100,6 @@ void TextBMFont::setString(const std::string& value)
102100
}
103101
_stringValue = value;
104102
_labelBMFontRenderer->setString(value);
105-
if (!_fntFileHasInit)
106-
{
107-
return;
108-
}
109103
updateContentSizeWithTextureSize(_labelBMFontRenderer->getContentSize());
110104
_labelBMFontRendererAdaptDirty = true;
111105
}

cocos/ui/UITextBMFont.h

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ class CC_GUI_DLL TextBMFont : public Widget
112112
virtual void adaptRenderers() override;
113113
protected:
114114
Label* _labelBMFontRenderer;
115-
bool _fntFileHasInit;
116115
std::string _fntFileName;
117116
std::string _stringValue;
118117
bool _labelBMFontRendererAdaptDirty;

0 commit comments

Comments
 (0)