Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit ed3209b

Browse files
author
Yuncong Zhang
committed
Fix empty paragraph layout issue.
1 parent 04df360 commit ed3209b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Runtime/ui/txt/paragraph.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,9 @@ public void layout(ParagraphConstraints constraints) {
297297
// Compute max(NumberOfWords(line) for line in lines), to determine the size of word buffers
298298
int maxWordCount = this._computeMaxWordCount();
299299
// Nothing to layout, if no visible character at all
300-
if (maxWordCount == 0) {
301-
return;
302-
}
303300

304301
if (_wordsBuffer == null || _wordsBuffer.Length < maxWordCount) {
305-
_wordsBuffer = new Range<int>[maxWordCount];
302+
_wordsBuffer = new Range<int>[maxWordCount < 4 ? 4 : maxWordCount];
306303
}
307304

308305
// Iterate through line ranges

0 commit comments

Comments
 (0)