فهرست منبع

Fixed TextView cursor not clamping to text length after text changed via Test=.

Mark Sibly 9 سال پیش
والد
کامیت
1d274216d0
2فایلهای تغییر یافته به همراه10 افزوده شده و 2 حذف شده
  1. 1 1
      modules/mojox/textfield.monkey2
  2. 9 1
      modules/mojox/textview.monkey2

+ 1 - 1
modules/mojox/textfield.monkey2

@@ -61,7 +61,7 @@ Class TextField Extends TextView
 	
 		_maxLength=maxLength
 		
-		App.RequestRender()
+		RequestRender()
 	End
 	
 	Protected

+ 9 - 1
modules/mojox/textview.monkey2

@@ -216,7 +216,6 @@ Class TextDocument
 			End
 		Endif
 		
-'		LinesModified( line0,eols1+1,eols2+1 )
 		LinesModified( line0,eols1,eols2 )
 		
 		TextChanged()
@@ -1609,6 +1608,15 @@ Class TextView Extends ScrollableView
 			liney+=size.y
 		Next
 		
+		If _cursor>_doc.TextLength
+			_cursor=_doc.TextLength
+			_anchor=_cursor
+			UpdateCursor()
+			RequestRender()
+		Else
+			_anchor=Min( _anchor,_doc.TextLength )
+		Endif
+		
 '		Print "Document width="+_lines.Top.maxWidth+", height="+_lines.Top.rect.Bottom
 	End