cocos2d-x
cocos2d-x copied to clipboard
Fix Label::draw
Fix Label::draw skips drawing when batchNodes are more than one and have empty quads
use continues will cause diifent font type show
It seems font type is same but missing outline. Do you have any test code to reproduce your issue?
@nameLogen, I could not reproduce your issue in my test code(see #20616), but I found similar case at BMFONT or CHARMAP. If you are using BMFONT or CHARMAP, could you try following patch as well?
--git a/cocos2d/cocos/2d/CCLabel.cpp b/cocos2d/cocos/2d/CCLabel.cpp
index 79a31ce..ad9b2f1 100644
--- a/cocos2d/cocos/2d/CCLabel.cpp
+++ b/cocos2d/cocos/2d/CCLabel.cpp
@@ -1749,7 +1749,7 @@ void Label::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
// ETC1 ALPHA supports for BMFONT & CHARMAP
auto textureAtlas = _batchNodes.at(0)->getTextureAtlas();
if(!textureAtlas->getTotalQuads())
- return;
+ continue;
auto texture = textureAtlas->getTexture();
auto& pipelineQuad = _quadCommand.getPipelineDescriptor();