mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-11 03:02:19 +00:00
more cursor up fixes
This commit is contained in:
1 parent
ab8c3c2b75
commit
87edda5972
1 file changed
+10
-6
@@ -1011,16 +1011,20 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
if (![self isSelectable])
|
||||
return;
|
||||
|
||||
var dindex = [self selectedRange].location,
|
||||
rectSource = [_layoutManager boundingRectForGlyphRange:CPMakeRange(dindex, 1) inTextContainer:_textContainer];
|
||||
|
||||
if (rectSource.origin.x > 0)
|
||||
dindex = [_layoutManager glyphIndexForPoint:CGPointMake(0, rectSource.origin.y + 1) inTextContainer:_textContainer fractionOfDistanceThroughGlyph:nil];
|
||||
var dindex = [self selectedRange].location;
|
||||
|
||||
if (dindex < 1)
|
||||
return;
|
||||
|
||||
rectSource = [_layoutManager boundingRectForGlyphRange:CPMakeRange(dindex - 1, 1) inTextContainer:_textContainer]; // the line above
|
||||
var rectSource = [_layoutManager boundingRectForGlyphRange:CPMakeRange(dindex, 1) inTextContainer:_textContainer];
|
||||
|
||||
if (!(dindex === [_layoutManager numberOfCharacters] && _isNewlineCharacter([[_textStorage string] characterAtIndex:dindex - 1])))
|
||||
dindex = [_layoutManager glyphIndexForPoint:CGPointMake(0, rectSource.origin.y + 1) inTextContainer:_textContainer fractionOfDistanceThroughGlyph:nil];
|
||||
|
||||
if (dindex < 1)
|
||||
return;
|
||||
|
||||
rectSource = [_layoutManager boundingRectForGlyphRange:CPMakeRange(dindex - 1, 1) inTextContainer:_textContainer];
|
||||
dindex = [_layoutManager glyphIndexForPoint:CGPointMake(_stickyXLocation, rectSource.origin.y + 1) inTextContainer:_textContainer fractionOfDistanceThroughGlyph:nil];
|
||||
|
||||
var oldStickyLoc = _stickyXLocation;
|
||||
|
||||
Reference in new issue
Block a user