Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2742 from ulion/fix_text_color_change

Fix color tag didn't hide bug introduced by PR2725. Fix #14293
  • Loading branch information...
commit 846ccff2d81853d3f1e5a3cba870a3df37dd9c28 2 parents 474a8e5 + 937e565
@jmarshallnz jmarshallnz authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 xbmc/guilib/GUITextLayout.cpp
View
5 xbmc/guilib/GUITextLayout.cpp
@@ -354,6 +354,7 @@ void CGUITextLayout::ParseText(const CStdStringW &text, uint32_t defaultStyle, v
{
uint32_t newStyle = 0;
color_t newColor = currentColor;
+ bool colorTagChange = false;
bool newLine = false;
// have a [ - check if it's an ON or OFF switch
bool on(true);
@@ -418,17 +419,19 @@ void CGUITextLayout::ParseText(const CStdStringW &text, uint32_t defaultStyle, v
// reuse existing color
newColor = it - colors.begin();
colorStack.push(newColor);
+ colorTagChange = true;
}
else if (!on && finish == pos + 5 && colorStack.size() > 1)
{ // revert to previous color
colorStack.pop();
newColor = colorStack.top();
+ colorTagChange = true;
}
if (finish != CStdString::npos)
pos = finish + 1;
}
- if (newStyle || newColor != currentColor || newLine)
+ if (newStyle || colorTagChange || newLine)
{ // we have a new style or a new color, so format up the previous segment
CStdStringW subText = text.Mid(startPos, endPos - startPos);
if (currentStyle & FONT_STYLE_UPPERCASE)
Please sign in to comment.
Something went wrong with that request. Please try again.