Issue 16471 (#16489)

* fix: Label updateColor() and underline color work as expected

fixes Github issue #15214 correctly. underline uses _displayColor
and not _textColorF. _textColorF is only for the text.
This also emulates the SystemFont underline behavior

fixes Github issue #16471

* docs: added more internal doc for issue_16471
This commit is contained in:
Ricardo Quesada 2016-09-01 01:59:40 -07:00 committed by minggo
parent db21e5f349
commit c32000250c
2 changed files with 4 additions and 1 deletions

View File

@ -1945,6 +1945,9 @@ void Label::updateDisplayedOpacity(GLubyte parentOpacity)
}
}
// FIXME: it is not clear what is the difference between setTextColor() and setColor()
// if setTextColor() only changes the text and nothing but the text (no glow, no outline, not underline)
// that's fine but it should be documented
void Label::setTextColor(const Color4B &color)
{
CCASSERT(_currentLabelType == LabelType::TTF || _currentLabelType == LabelType::STRING_TEXTURE, "Only supported system font and ttf!");

View File

@ -3197,7 +3197,7 @@ std::string LabelIssue15214::title() const
std::string LabelIssue15214::subtitle() const
{
return "Font and underline should be of the same color";
return "Font + underline: same color with setColor()";
}
//