aboutsummaryrefslogtreecommitdiff
path: root/guilib/GUIFont.cpp
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2009-11-10 09:20:34 +0000
committerjmarshallnz <jmarshallnz@svn>2009-11-10 09:20:34 +0000
commit998e945f83cdac06c40214a85aec11af705f6320 (patch)
treeb936c2396f2c9306a18577ada28613f6610231e5 /guilib/GUIFont.cpp
parentd2ce97eedbccbea00cfb8f3743a7bbd00bc3dc96 (diff)
fixed: If text is transparent, don't draw the shadow.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@24486 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIFont.cpp')
-rw-r--r--guilib/GUIFont.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/guilib/GUIFont.cpp b/guilib/GUIFont.cpp
index a73bfc6932..5d3b7cd1ab 100644
--- a/guilib/GUIFont.cpp
+++ b/guilib/GUIFont.cpp
@@ -85,7 +85,13 @@ void CGUIFont::DrawText( float x, float y, const vecColors &colors, color_t shad
renderColors.push_back(g_graphicsContext.MergeAlpha(colors[i] ? colors[i] : m_textColor));
if (!shadowColor) shadowColor = m_shadowColor;
if (shadowColor)
- m_font->DrawTextInternal(x + 1, y + 1, g_graphicsContext.MergeAlpha(shadowColor), text, alignment, maxPixelWidth, false);
+ {
+ shadowColor = g_graphicsContext.MergeAlpha(shadowColor);
+ vecColors shadowColors;
+ for (unsigned int i = 0; i < renderColors.size(); i++)
+ shadowColors.push_back((renderColors[i] & 0xff000000) != 0 ? shadowColor : 0);
+ m_font->DrawTextInternal(x + 1, y + 1, shadowColors, text, alignment, maxPixelWidth, false);
+ }
m_font->DrawTextInternal( x, y, renderColors, text, alignment, maxPixelWidth, false);
if (clip)
@@ -196,8 +202,13 @@ void CGUIFont::DrawScrollingText(float x, float y, const vecColors &colors, colo
bool scroll = !scrollInfo.waitTime && scrollInfo.pixelSpeed;
if (shadowColor)
- m_font->DrawTextInternal(x - offset + 1, y + 1, g_graphicsContext.MergeAlpha(shadowColor), renderText, alignment, maxWidth + scrollInfo.pixelPos + m_font->GetLineHeight(2.0f), scroll);
-
+ {
+ shadowColor = g_graphicsContext.MergeAlpha(shadowColor);
+ vecColors shadowColors;
+ for (unsigned int i = 0; i < renderColors.size(); i++)
+ shadowColors.push_back((renderColors[i] & 0xff000000) != 0 ? shadowColor : 0);
+ m_font->DrawTextInternal(x - offset + 1, y + 1, shadowColors, renderText, alignment, maxWidth + scrollInfo.pixelPos + m_font->GetLineHeight(2.0f), scroll);
+ }
m_font->DrawTextInternal(x - offset, y, renderColors, renderText, alignment, maxWidth + scrollInfo.pixelPos + m_font->GetLineHeight(2.0f), scroll);
g_graphicsContext.RestoreClipRegion();