Merge pull request #4533 from jherico/tr2

Fixing consecutive spaces issue with text renderer
This commit is contained in:
Brad Hefta-Gaub 2015-03-30 17:34:42 -07:00
commit e1da9331e3

View file

@ -359,8 +359,12 @@ void Font::setupGL() {
// FIXME there has to be a cleaner way of doing this
QStringList Font::tokenizeForWrapping(const QString & str) const {
QStringList result;
foreach(const QString & token1, str.split(" ", QString::SkipEmptyParts)) {
foreach(const QString & token1, str.split(" ")) {
bool lineFeed = false;
if (token1.isEmpty()) {
result << token1;
continue;
}
foreach(const QString & token2, token1.split("\n")) {
if (lineFeed) {
result << "\n";