Merge pull request #1739 from s-walrus/fix/font-getwrap-final-newline

Fix #1707: Font:getWrap() removing final newline charancter
This commit is contained in:
Alex Szpakowski
2021-11-20 16:43:56 -04:00
committed by GitHub
+4 -7
View File
@@ -896,14 +896,11 @@ void Font::getWrap(const ColoredCodepoints &codepoints, float wraplimit, std::ve
}
// Push the last line.
if (!wline.cps.empty())
{
lines.push_back(wline);
lines.push_back(wline);
// Ignore the width of any trailing spaces, for individual lines.
if (linewidths)
linewidths->push_back(width - widthoftrailingspace);
}
// Ignore the width of any trailing spaces, for individual lines.
if (linewidths)
linewidths->push_back(width - widthoftrailingspace);
}
void Font::getWrap(const std::vector<ColoredString> &text, float wraplimit, std::vector<std::string> &lines, std::vector<int> *linewidths)