Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Label::draw #20528

Open
wants to merge 1 commit into
base: v4
Choose a base branch
from
Open

Fix Label::draw #20528

wants to merge 1 commit into from

Conversation

realnick
Copy link

Fix Label::draw skips drawing when batchNodes are more than one and have empty quads

zhongfq added a commit to zhongfq/cocos-lua that referenced this pull request Jun 1, 2020
u0u0 added a commit to u0u0/Cocos2d-Lua-Community that referenced this pull request Jun 21, 2020
@nameLogen
Copy link

image
use continues will cause diifent font type show

@realnick
Copy link
Author

realnick commented Nov 21, 2020

It seems font type is same but missing outline. Do you have any test code to reproduce your issue?

@realnick
Copy link
Author

@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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants