浏览代码

fix ArgumentOutOfRangeException

/main
fzhangtj 6 年前
当前提交
07eb1703
共有 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));

正在加载...
取消
保存