fixed: insertion point was wrong sometimes when dragging beyond last character

This commit is contained in:
daboe01 committed 2016-12-26 23:30:23 +01:00
1 parent 3d9aa24f3c
commit baa313e8f8
1 file changed
+4
+4
View File
@@ -2423,6 +2423,10 @@ var CPTextViewAllowsUndoKey = @"CPTextViewAllowsUndoKey",
- (void)_drawCaretAtLocation:(int)aLoc
{
var rect = [_textView._layoutManager boundingRectForGlyphRange:CPMakeRange(aLoc, 1) inTextContainer:_textView._textContainer];
if (aLoc >= [_textView._layoutManager numberOfCharacters])
rect.origin.x = CGRectGetMaxX(rect)
[self setRect:rect];
}