@@ -2466,18 +2466,16 @@ void Label::updateColor()
2466
2466
// special opacity for premultiplied textures
2467
2467
if (_isOpacityModifyRGB)
2468
2468
{
2469
- color.r *= _displayedOpacity / 255 . 0f ;
2470
- color.g *= _displayedOpacity / 255 . 0f ;
2471
- color.b *= _displayedOpacity / 255 . 0f ;
2469
+ color.r *= color. a ;
2470
+ color.g *= color. a ;
2471
+ color.b *= color. a ;
2472
2472
}
2473
2473
2474
- ax::TextureAtlas* textureAtlas;
2475
- V3F_C4F_T2F_Quad* quads;
2476
2474
for (auto && batchNode : _batchNodes)
2477
2475
{
2478
- textureAtlas = batchNode->getTextureAtlas ();
2479
- quads = textureAtlas->getQuads ();
2480
- auto count = textureAtlas->getTotalQuads ();
2476
+ auto textureAtlas = batchNode->getTextureAtlas ();
2477
+ auto quads = textureAtlas->getQuads ();
2478
+ auto count = textureAtlas->getTotalQuads ();
2481
2479
2482
2480
for (int index = 0 ; index < count; ++index)
2483
2481
{
@@ -2899,7 +2897,7 @@ bool Label::multilineTextWrap(const std::function<int(const std::u32string&, int
2899
2897
{
2900
2898
recordPlaceholderInfo (letterIndex, character);
2901
2899
AXLOGW (" LabelTextFormatter error: can't find letter definition in font file for letter: 0x{:x}" ,
2902
- static_cast <uint32_t >(character));
2900
+ static_cast <uint32_t >(character));
2903
2901
continue ;
2904
2902
}
2905
2903
@@ -3115,11 +3113,11 @@ void Label::recordLetterInfo(const ax::Vec2& point, char32_t utf32Char, int lett
3115
3113
LetterInfo tmpInfo;
3116
3114
_lettersInfo.emplace_back (tmpInfo);
3117
3115
}
3118
- _lettersInfo[letterIndex].lineIndex = lineIndex;
3119
- _lettersInfo[letterIndex].utf32Char = utf32Char;
3120
- _lettersInfo[letterIndex].valid = _fontAtlas->_letterDefinitions [utf32Char].validDefinition && utf32Char != ' ' ;
3121
- _lettersInfo[letterIndex].positionX = point.x ;
3122
- _lettersInfo[letterIndex].positionY = point.y ;
3116
+ _lettersInfo[letterIndex].lineIndex = lineIndex;
3117
+ _lettersInfo[letterIndex].utf32Char = utf32Char;
3118
+ _lettersInfo[letterIndex].valid = _fontAtlas->_letterDefinitions [utf32Char].validDefinition && utf32Char != ' ' ;
3119
+ _lettersInfo[letterIndex].positionX = point.x ;
3120
+ _lettersInfo[letterIndex].positionY = point.y ;
3123
3121
_lettersInfo[letterIndex].atlasIndex = -1 ;
3124
3122
}
3125
3123
@@ -3134,4 +3132,4 @@ void Label::recordPlaceholderInfo(int letterIndex, char32_t utf32Char)
3134
3132
_lettersInfo[letterIndex].valid = false ;
3135
3133
}
3136
3134
3137
- }
3135
+ } // namespace ax
0 commit comments