use fraction again in cursorUp

This commit is contained in:
daboe01 committed 2015-12-31 10:42:33 +01:00
1 parent 87edda5972
commit 0e17658269
1 file changed
+5 -1
+5 -1
View File
@@ -1024,8 +1024,12 @@ var kDelegateRespondsTo_textShouldBeginEditing
if (dindex < 1)
return;
var fraction = [];
rectSource = [_layoutManager boundingRectForGlyphRange:CPMakeRange(dindex - 1, 1) inTextContainer:_textContainer];
dindex = [_layoutManager glyphIndexForPoint:CGPointMake(_stickyXLocation, rectSource.origin.y + 1) inTextContainer:_textContainer fractionOfDistanceThroughGlyph:nil];
dindex = [_layoutManager glyphIndexForPoint:CGPointMake(_stickyXLocation, rectSource.origin.y + 1) inTextContainer:_textContainer fractionOfDistanceThroughGlyph:fraction];
if (fraction[0] > 0.5)
dindex++;
var oldStickyLoc = _stickyXLocation;
[self _establishSelection:CPMakeRange(dindex,0) byExtending:NO];