소스 검색

Small fix to ensure inbound index when moving cursor vertically (#1206)

robShiro 1 년 전
부모
커밋
d00340fbf8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      h2d/TextInput.hx

+ 1 - 1
h2d/TextInput.hx

@@ -373,7 +373,7 @@ class TextInput extends Text {
 		}
 		if (cursorLineIndex == -1)
 			return;
-		var destinationIndex = hxd.Math.iclamp(cursorLineIndex + yDiff, 0, lines.length);
+		var destinationIndex = hxd.Math.iclamp(cursorLineIndex + yDiff, 0, lines.length - 1);
 		if (destinationIndex == cursorLineIndex)
 			return;
 		var current = lines[cursorLineIndex];