浏览代码

Let findWords return null if empty.

/main
Yuncong Zhang 5 年前
当前提交
2bd06313
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 8
      Runtime/ui/txt/paragraph.cs

8
Runtime/ui/txt/paragraph.cs


lineNumber != lineLimit - 1 && !lineRange.hardBreak;
Range<int>[] words = this._findWords(lineRange.start, lineRange.end);
float wordGapWidth = !(justifyLine && words.Length > 1)
float wordGapWidth = !(justifyLine && words != null && words.Length > 1)
? 0
: (this._width - this._lineWidths[lineNumber]) / (words.Length - 1);

builder.positions[glyphIndex] = new Vector2d(glyphXOffset);
lineGlyphPositions[pLineGlyphPositions++] = new GlyphPosition(runXOffset + glyphXOffset, glyphAdvance,
new Range<int>(textStart + glyphIndex, textStart + glyphIndex + 1));
if (wordIndex < words.Length) {
if (words != null && wordIndex < words.Length) {
Range<int> word = words[wordIndex];
if (word.start == runStart + glyphIndex) {
wordStartPosition = runXOffset + glyphXOffset;

if (inWord) {
wordCount++;
}
if (wordCount == 0) {
return null;
}
Range<int>[] words = new Range<int>[wordCount];

正在加载...
取消
保存