浏览代码

Fix text align bug introduced by textblob sharing position array.

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

9
Runtime/ui/txt/paragraph.cs


bool hardBreak = this._lineRanges[lineNumber].hardBreak;
if (this._shouldConsiderEllipsis(hardBreak, isLastLineStyleRun, lineNumber, lineLimit)) {
this._handleOverflowEllipsis(ref text, ref textStart, ref textCount, run.style, runXOffset);
this._handleOverflowEllipsis(ref text, textStart, ref textCount, run.style, runXOffset);
if (this._paragraphStyle.maxLines == null) {
lineLimit = lineNumber + 1;
this._didExceedMaxLines = true;

&& isLastLineStyleRun && (lineNumber == lineLimit - 1 || this._paragraphStyle.maxLines == null);
}
void _handleOverflowEllipsis(ref string text, ref int textStart, ref int textCount, TextStyle style,
void _handleOverflowEllipsis(ref string text, int textStart, ref int textCount, TextStyle style,
float runXOffset) {
// By now, all characters have been "RequestCharactersInTexture"d by computeLineBreaks
// except the ellipsis, so Layout.doLayout skips calling RequestCharactersInTexture for

truncateCount++;
}
text = this._text.Substring(textStart, textCount - truncateCount) + this._paragraphStyle.ellipsis;
textStart = 0;
textCount = text.Length;
text = text.Substring(0, textStart + textCount - truncateCount) + this._paragraphStyle.ellipsis;
textCount = text.Length - textStart;
}
void _populateGlyphPositions(int textStart, int textCount,

正在加载...
取消
保存