@@ -1728,8 +1728,8 @@ void Label::updateContent()
1728
1728
// which is POT
1729
1729
y += spriteSize.height / 2 ;
1730
1730
// FIXME: Might not work with different vertical alignments
1731
- _underlineNode->drawLine (Vec2 (0 .0f , y), Vec2 (spriteSize.width , y),
1732
- Color (_textSprite-> getDisplayedColor ()), spriteSize.height / 6 );
1731
+ _underlineNode->drawLine (Vec2 (0 .0f , y), Vec2 (spriteSize.width , y), Color (_textSprite-> getDisplayedColor ()),
1732
+ spriteSize.height / 6 );
1733
1733
}
1734
1734
}
1735
1735
@@ -2387,18 +2387,16 @@ void Label::updateColor()
2387
2387
// special opacity for premultiplied textures
2388
2388
if (_isOpacityModifyRGB)
2389
2389
{
2390
- color.r *= _displayedOpacity / 255 . 0f ;
2391
- color.g *= _displayedOpacity / 255 . 0f ;
2392
- color.b *= _displayedOpacity / 255 . 0f ;
2390
+ color.r *= color. a ;
2391
+ color.g *= color. a ;
2392
+ color.b *= color. a ;
2393
2393
}
2394
2394
2395
- ax::TextureAtlas* textureAtlas;
2396
- V3F_C4F_T2F_Quad* quads;
2397
2395
for (auto && batchNode : _batchNodes)
2398
2396
{
2399
- textureAtlas = batchNode->getTextureAtlas ();
2400
- quads = textureAtlas->getQuads ();
2401
- auto count = textureAtlas->getTotalQuads ();
2397
+ auto textureAtlas = batchNode->getTextureAtlas ();
2398
+ auto quads = textureAtlas->getQuads ();
2399
+ auto count = textureAtlas->getTotalQuads ();
2402
2400
2403
2401
for (int index = 0 ; index < count; ++index)
2404
2402
{
@@ -2820,7 +2818,7 @@ bool Label::multilineTextWrap(const std::function<int(const std::u32string&, int
2820
2818
{
2821
2819
recordPlaceholderInfo (letterIndex, character);
2822
2820
AXLOGW (" LabelTextFormatter error: can't find letter definition in font file for letter: 0x{:x}" ,
2823
- static_cast <uint32_t >(character));
2821
+ static_cast <uint32_t >(character));
2824
2822
continue ;
2825
2823
}
2826
2824
@@ -3036,11 +3034,11 @@ void Label::recordLetterInfo(const ax::Vec2& point, char32_t utf32Char, int lett
3036
3034
LetterInfo tmpInfo;
3037
3035
_lettersInfo.emplace_back (tmpInfo);
3038
3036
}
3039
- _lettersInfo[letterIndex].lineIndex = lineIndex;
3040
- _lettersInfo[letterIndex].utf32Char = utf32Char;
3041
- _lettersInfo[letterIndex].valid = _fontAtlas->_letterDefinitions [utf32Char].validDefinition && utf32Char != ' ' ;
3042
- _lettersInfo[letterIndex].positionX = point.x ;
3043
- _lettersInfo[letterIndex].positionY = point.y ;
3037
+ _lettersInfo[letterIndex].lineIndex = lineIndex;
3038
+ _lettersInfo[letterIndex].utf32Char = utf32Char;
3039
+ _lettersInfo[letterIndex].valid = _fontAtlas->_letterDefinitions [utf32Char].validDefinition && utf32Char != ' ' ;
3040
+ _lettersInfo[letterIndex].positionX = point.x ;
3041
+ _lettersInfo[letterIndex].positionY = point.y ;
3044
3042
_lettersInfo[letterIndex].atlasIndex = -1 ;
3045
3043
}
3046
3044
@@ -3055,4 +3053,4 @@ void Label::recordPlaceholderInfo(int letterIndex, char32_t utf32Char)
3055
3053
_lettersInfo[letterIndex].valid = false ;
3056
3054
}
3057
3055
3058
- }
3056
+ } // namespace ax
0 commit comments