Fixed another failure mode for the wrapText shaped text hack

This commit is contained in:
Leon Styhre 2024-08-03 14:22:36 +02:00
parent 4931ea9749
commit 75b93794b0

View file

@ -385,7 +385,7 @@ std::string Font::wrapText(const std::string& text,
lastSpacePos = lineWidth;
}
if (lineWidth + charWidth <= maxLength) {
if (lineWidth + charWidth <= maxLength || skipAbbreviation) {
if (lineWidth + charWidth + dotsWidth > maxLength)
dotsSection.emplace_back(std::make_pair(byteCount, charWidth));
lineWidth += charWidth;