Fixed a small text abbreviation issue.

This commit is contained in:
Leon Styhre 2022-08-21 21:24:46 +02:00
parent e2fb03dbf3
commit 047d080346

View file

@ -529,7 +529,7 @@ std::string Font::wrapText(std::string text, float maxLength, float maxHeight, f
// If the word is too long to fit within maxLength then abbreviate it.
if (sizeText(word).x > maxLength) {
if (line != "") {
if (line != "" && line.back() != '\n') {
if (restrictHeight) {
if (accumHeight + lineHeight > maxHeight)
continue;