Changeset - r26767:1f762077f5d4
[Not reviewed]
master
0 1 0
Rubidium - 22 months ago 2023-01-15 07:51:00
rubidium@openttd.org
Fix #10057: FallbackParagraphLayout fails to properly wrap

... during the first word after a new run has been started.
1 file changed with 1 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/gfx_layout.cpp
Show inline comments
 
@@ -549,14 +549,12 @@ std::unique_ptr<const ParagraphLayouter:
 
			l->emplace_back(iter->second, begin, this->buffer - begin, w);
 
			iter++;
 
			assert(iter != this->runs.End());
 

	
 
			next_run = this->buffer_begin + iter->first;
 
			begin = this->buffer;
 

	
 
			last_space = nullptr;
 
		}
 

	
 
		if (IsWhitespace(c)) last_space = this->buffer;
 

	
 
		if (IsPrintable(c) && !IsTextDirectionChar(c)) {
 
			int char_width = GetCharacterWidth(fc->GetSize(), c);
 
@@ -588,13 +586,13 @@ std::unique_ptr<const ParagraphLayouter:
 
			}
 
		}
 

	
 
		this->buffer++;
 
	}
 

	
 
	if (l->size() == 0 || last_char - begin != 0) {
 
	if (l->size() == 0 || last_char - begin > 0) {
 
		int w = l->GetWidth();
 
		l->emplace_back(iter->second, begin, last_char - begin, w);
 
	}
 
	return l;
 
}
 

	
0 comments (0 inline, 0 general)