From b840738e20b65a94169d0efb2823a59788815792 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 16 Oct 2019 15:03:39 +0800 Subject: [PATCH] sync #19914 --- cocos/2d/CCFontAtlas.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index 7a529acdf2f9..5818b2c2048c 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -60,6 +60,13 @@ FontAtlas::FontAtlas(Font &theFont) { _letterPadding += 2 * FontFreeType::DistanceMapSpread; } + + auto outlineSize = _fontFreeType->getOutlineSize(); + if (outlineSize > 0) + { + _lineHeight += 2 * outlineSize; + } + #if CC_ENABLE_CACHE_TEXTURE_DATA auto eventDispatcher = Director::getInstance()->getEventDispatcher(); @@ -87,7 +94,6 @@ void FontAtlas::reinit() auto outlineSize = _fontFreeType->getOutlineSize(); if(outlineSize > 0) { - _lineHeight += 2 * outlineSize; _currentPageDataSize *= 2; _currentPageDataSizeRGBA = _currentPageDataSize * 2;