mirror of https://github.com/axmolengine/axmol.git
Merge pull request #14656 from zilongshanren/v3.10
fix bmfont size initialize error
This commit is contained in:
commit
b87e638f26
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue