Merge pull request #14656 from zilongshanren/v3.10

fix bmfont size initialize error
This commit is contained in:
zilongshanren 2015-12-13 22:22:05 +08:00
commit b87e638f26
1 changed files with 1 additions and 3 deletions

View File

@ -591,11 +591,9 @@ bool Label::setBMFontFilePath(const std::string& bmfontFilePath, const Vec2& ima
FontFNT *bmFont = (FontFNT*)newAtlas->getFont(); FontFNT *bmFont = (FontFNT*)newAtlas->getFont();
if (bmFont) { if (bmFont) {
float originalFontSize = bmFont->getOriginalFontSize(); float originalFontSize = bmFont->getOriginalFontSize();
if(fabs(_bmFontSize+1) < FLT_EPSILON){
_bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR(); _bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR();
} }
} }
}
if(fontSize > 0.0f){ if(fontSize > 0.0f){
_bmFontSize = fontSize; _bmFontSize = fontSize;