Skip to content

Commit

Permalink
Merge pull request #4264 from jmarshallnz/scrollfix
Browse files Browse the repository at this point in the history
[gui] scrolling text could be truncated
  • Loading branch information
jmarshallnz committed Feb 23, 2014
2 parents 3c0d901 + 56c1065 commit 4bb0032
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xbmc/guilib/GUIFont.cpp
Expand Up @@ -204,7 +204,7 @@ void CGUIFont::DrawScrollingText(float x, float y, const vecColors &colors, colo
if (!text.size() || ClippedRegionIsEmpty(x, y, maxWidth, alignment))
return; // nothing to render

maxWidth = ROUND(maxWidth / g_graphicsContext.GetGUIScaleX());
maxWidth = ROUND((maxWidth + scrollInfo.pixelPos) / g_graphicsContext.GetGUIScaleX());

float charWidth = GetCharWidth(scrollInfo.GetCurrentChar(text));
float offset;
Expand Down Expand Up @@ -239,9 +239,9 @@ void CGUIFont::DrawScrollingText(float x, float y, const vecColors &colors, colo
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 + 1, y + 1, shadowColors, renderText, alignment, maxWidth + m_font->GetLineHeight(2.0f), scroll);
}
m_font->DrawTextInternal(x - offset, y, renderColors, renderText, alignment, maxWidth + scrollInfo.pixelPos + m_font->GetLineHeight(2.0f), scroll);
m_font->DrawTextInternal(x - offset, y, renderColors, renderText, alignment, maxWidth + m_font->GetLineHeight(2.0f), scroll);

g_graphicsContext.RestoreClipRegion();
}
Expand Down

0 comments on commit 4bb0032

Please sign in to comment.