From 39d01a1da88a77192d36cbc69502b33be367b626 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Wed, 28 Sep 2016 16:15:31 +0200 Subject: [PATCH] sizing correction for dragging --- AppKit/CPTextView/CPTextView.j | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index 7c83858e0..d98000baa 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -942,7 +942,11 @@ var kDelegateRespondsTo_textShouldBeginEditing _movingSelection = CPMaxRange(_startTrackingLocation, 0); var dragPlaceholder = [CPTextField new], originPoint = [_layoutManager locationForGlyphAtIndex:[self selectedRange].location]; - + + originPoint.y -= [_layoutManager _descentAtLocation:_selectionRange.location]; + originPoint.x += _textContainerOrigin.x; + originPoint.y += _textContainerOrigin.y; + [dragPlaceholder setStringValue:[[self stringValue] substringWithRange:_selectionRange]]; [dragPlaceholder sizeToFit];