mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 07:05:39 +00:00
Fixed a text abbreviation issue.
This commit is contained in:
parent
49c9710afc
commit
f048d06b95
|
@ -340,7 +340,8 @@ std::string Font::wrapText(std::string text, float maxLength, float maxHeight, f
|
||||||
if (restrictHeight && currLineLength != 0.0f && maxHeight < lineHeight &&
|
if (restrictHeight && currLineLength != 0.0f && maxHeight < lineHeight &&
|
||||||
wordSize > maxLength - textSize.x) {
|
wordSize > maxLength - textSize.x) {
|
||||||
// Multi-word lines.
|
// Multi-word lines.
|
||||||
if (maxLength - currLineLength + dotsSize < wordSize) {
|
if (maxLength - currLineLength + dotsSize < wordSize &&
|
||||||
|
sizeText(line).x + dotsSize > maxLength) {
|
||||||
while (sizeText(line).x + dotsSize > maxLength)
|
while (sizeText(line).x + dotsSize > maxLength)
|
||||||
line.pop_back();
|
line.pop_back();
|
||||||
}
|
}
|
||||||
|
@ -353,6 +354,9 @@ std::string Font::wrapText(std::string text, float maxLength, float maxHeight, f
|
||||||
line = line + word;
|
line = line + word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (line.back() == ' ')
|
||||||
|
line.pop_back();
|
||||||
|
|
||||||
line.append("...");
|
line.append("...");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -411,6 +415,8 @@ std::string Font::wrapText(std::string text, float maxLength, float maxHeight, f
|
||||||
out.pop_back();
|
out.pop_back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (out.back() == ' ')
|
||||||
|
out.pop_back();
|
||||||
out.append("...");
|
out.append("...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue