mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Font:getWrap can now accept a colored text table in the same format as what's accepted by love.graphics.print. Resolves issue #1108.
The returned table of strings still has no color information.
This commit is contained in:
@@ -901,13 +901,13 @@ void Font::getWrap(const ColoredCodepoints &codepoints, float wraplimit, std::ve
|
||||
}
|
||||
}
|
||||
|
||||
void Font::getWrap(const std::string &text, float wraplimit, std::vector<std::string> &lines, std::vector<int> *linewidths)
|
||||
void Font::getWrap(const std::vector<ColoredString> &text, float wraplimit, std::vector<std::string> &lines, std::vector<int> *linewidths)
|
||||
{
|
||||
ColoredCodepoints codepoints;
|
||||
getCodepointsFromString(text, codepoints.cps);
|
||||
ColoredCodepoints cps;
|
||||
getCodepointsFromString(text, cps);
|
||||
|
||||
std::vector<ColoredCodepoints> codepointlines;
|
||||
getWrap(codepoints, wraplimit, codepointlines, linewidths);
|
||||
getWrap(cps, wraplimit, codepointlines, linewidths);
|
||||
|
||||
std::string line;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user