mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-21 21:55:38 +00:00
Fixed a line wrapping issue for text with blank lines that was not displayed in a scrollable container
This commit is contained in:
parent
fba314ad04
commit
0f3db2fbf1
|
@ -279,14 +279,18 @@ std::string Font::wrapText(const std::string& text,
|
|||
std::vector<std::pair<size_t, float>> dotsSection;
|
||||
bool addDots {false};
|
||||
|
||||
for (size_t i = 0; i < text.length(); ++i) {
|
||||
for (size_t i {0}; i < text.length(); ++i) {
|
||||
if (text[i] == '\n') {
|
||||
if (!multiLine) {
|
||||
addDots = true;
|
||||
break;
|
||||
}
|
||||
wrappedText.append("\n");
|
||||
accumHeight += lineHeight;
|
||||
if (maxHeight != 0.0f && accumHeight > maxHeight) {
|
||||
addDots = true;
|
||||
break;
|
||||
}
|
||||
wrappedText.append("\n");
|
||||
lineWidth = 0.0f;
|
||||
lastSpace = 0;
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue