using string::empty() for judge whether string is empty.

This commit is contained in:
Dhilan007 2014-03-12 15:03:22 +08:00
parent 233b04269b
commit 2786b40dc3
1 changed files with 4 additions and 6 deletions

View File

@ -940,7 +940,7 @@ void Label::updateContent()
void Label::visit(Renderer *renderer, const kmMat4 &parentTransform, bool parentTransformUpdated) void Label::visit(Renderer *renderer, const kmMat4 &parentTransform, bool parentTransformUpdated)
{ {
if (! _visible || _originalUTF8String.length() == 0) if (! _visible || _originalUTF8String.empty())
{ {
return; return;
} }
@ -1005,10 +1005,8 @@ const std::string& Label::getFontName() const
{ {
switch (_currentLabelType) switch (_currentLabelType)
{ {
case cocos2d::Label::LabelType::TTF: case LabelType::TTF:
return _fontConfig.fontFilePath; return _fontConfig.fontFilePath;
case cocos2d::Label::LabelType::STRING_TEXTURE:
return _fontDefinition._fontName;
default: default:
return _fontDefinition._fontName; return _fontDefinition._fontName;
} }
@ -1046,9 +1044,9 @@ int Label::getFontSize() const
{ {
switch (_currentLabelType) switch (_currentLabelType)
{ {
case cocos2d::Label::LabelType::TTF: case LabelType::TTF:
return _fontConfig.fontSize; return _fontConfig.fontSize;
case cocos2d::Label::LabelType::STRING_TEXTURE: case LabelType::STRING_TEXTURE:
return _fontDefinition._fontSize; return _fontDefinition._fontSize;
default: default:
return 0; return 0;