mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-05 21:57:20 +00:00
Limit the text used on each NewsItem
This commit is contained in:
parent
ae4542fb92
commit
c930ca1098
@ -271,6 +271,19 @@ void NewsListBox::parseFile(const std::string& filename)
|
||||
std::string title = titleXml->GetText();
|
||||
std::string desc = parse_html(descXml->GetText());
|
||||
|
||||
// Limit the description text to 4 lines
|
||||
std::string::size_type i = 0;
|
||||
int j = 0;
|
||||
while (true) {
|
||||
i = desc.find('\n', i);
|
||||
if (i == std::string::npos)
|
||||
break;
|
||||
i++;
|
||||
j++;
|
||||
if (j == 5)
|
||||
desc = desc.substr(0, i);
|
||||
}
|
||||
|
||||
addChild(new NewsItem(link, title, desc));
|
||||
|
||||
itemXml = itemXml->NextSiblingElement();
|
||||
|
Loading…
Reference in New Issue
Block a user