mirror of https://github.com/OpenTTD/OpenTTD
Fix #10057: FallbackParagraphLayout fails to properly wrap
... during the first word after a new run has been started.pull/10360/head
parent
96ec9908a0
commit
c578917783
|
@ -552,8 +552,6 @@ std::unique_ptr<const ParagraphLayouter::Line> FallbackParagraphLayout::NextLine
|
||||||
|
|
||||||
next_run = this->buffer_begin + iter->first;
|
next_run = this->buffer_begin + iter->first;
|
||||||
begin = this->buffer;
|
begin = this->buffer;
|
||||||
|
|
||||||
last_space = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsWhitespace(c)) last_space = this->buffer;
|
if (IsWhitespace(c)) last_space = this->buffer;
|
||||||
|
@ -591,7 +589,7 @@ std::unique_ptr<const ParagraphLayouter::Line> FallbackParagraphLayout::NextLine
|
||||||
this->buffer++;
|
this->buffer++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l->size() == 0 || last_char - begin != 0) {
|
if (l->size() == 0 || last_char - begin > 0) {
|
||||||
int w = l->GetWidth();
|
int w = l->GetWidth();
|
||||||
l->emplace_back(iter->second, begin, last_char - begin, w);
|
l->emplace_back(iter->second, begin, last_char - begin, w);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue