浏览代码

Merge pull request #27 from UnityTech/text

fix ArgumentOutOfRangeException
/main
GitHub 6 年前
当前提交
21e8df18
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 2
      Assets/UIWidgets/painting/text_painter.cs

2
Assets/UIWidgets/painting/text_painter.cs


{
D.assert(!_needsLayout);
var offset = getOffsetForCaret(position, Rect.zero);
var lineIndex = Math.Min(Math.Max(_paragraph.getLine(position) + move, 0), _paragraph.getLineCount());
var lineIndex = Math.Min(Math.Max(_paragraph.getLine(position) + move, 0), _paragraph.getLineCount() - 1);
var targetLineStart = _paragraph.getLineRange(lineIndex).start;
var newLineOffset = getOffsetForCaret(new TextPosition(targetLineStart), Rect.zero);
return getPositionForOffset(new Offset(offset.dx, newLineOffset.dy));

正在加载...
取消
保存