Skip to content

Commit

Permalink
fixed: #11016 - <wrapmultiline> didn't honour label <height> value
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Marshall committed Jan 27, 2011
1 parent 145a428 commit 104ff25
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xbmc/guilib/GUITextLayout.cpp
Expand Up @@ -456,7 +456,7 @@ void CGUITextLayout::WrapText(const vecText &text, float maxWidth)
vecText::const_iterator pos = line.m_text.begin();
unsigned int lastSpaceInLine = 0;
vecText curLine;
while (pos != line.m_text.end() && (nMaxLines <= 0 || m_lines.size() < (size_t)nMaxLines))
while (pos != line.m_text.end())
{
// Get the current letter in the string
character_t letter = *pos;
Expand All @@ -470,6 +470,9 @@ void CGUITextLayout::WrapText(const vecText &text, float maxWidth)
{
CGUIString string(curLine.begin(), curLine.begin() + lastSpaceInLine, false);
m_lines.push_back(string);
// check for exceeding our number of lines
if (nMaxLines > 0 && m_lines.size() >= (size_t)nMaxLines)
return;
// skip over spaces
pos = lastSpace;
while (pos != line.m_text.end() && IsSpace(*pos))
Expand All @@ -495,13 +498,19 @@ void CGUITextLayout::WrapText(const vecText &text, float maxWidth)
{
CGUIString string(curLine.begin(), curLine.begin() + lastSpaceInLine, false);
m_lines.push_back(string);
// check for exceeding our number of lines
if (nMaxLines > 0 && m_lines.size() >= (size_t)nMaxLines)
return;
curLine.erase(curLine.begin(), curLine.begin() + lastSpaceInLine);
while (curLine.size() && IsSpace(curLine.at(0)))
curLine.erase(curLine.begin());
}
}
CGUIString string(curLine.begin(), curLine.end(), true);
m_lines.push_back(string);
// check for exceeding our number of lines
if (nMaxLines > 0 && m_lines.size() >= (size_t)nMaxLines)
return;
}
}

Expand Down

0 comments on commit 104ff25

Please sign in to comment.