mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-22 18:30:43 +00:00
various baseline fixes
This commit is contained in:
@@ -663,7 +663,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
[self insertText:placeholderString]; // FIXME: this hack to provide the visual space for the inputmanager should at least bypass the undomanager
|
||||
|
||||
var caretOrigin = [_layoutManager boundingRectForGlyphRange:CPMakeRange(MAX(0, _selectionRange.location - 1), 1) inTextContainer:_textContainer].origin;
|
||||
caretOrigin.y += [_layoutManager _characterOffsetAtLocation:MAX(0, _selectionRange.location - 1) inTextContainer:_textContainer];
|
||||
caretOrigin.y += [_layoutManager _characterOffsetAtLocation:MAX(0, _selectionRange.location - 1)];
|
||||
caretOrigin.x += 2; // two pixel offset to the LHS character
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
@@ -922,7 +922,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
rectSource = [_layoutManager boundingRectForGlyphRange:CPMakeRange(sindex, 1) inTextContainer:_textContainer],
|
||||
point = rectSource.origin;
|
||||
|
||||
if (point.y <= 0)
|
||||
if (point.y <= 2)
|
||||
return;
|
||||
|
||||
if (_stickyXLocation)
|
||||
@@ -1780,14 +1780,19 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
else
|
||||
caretRect = [_layoutManager boundingRectForGlyphRange:CPMakeRange(_selectionRange.location, 1) inTextContainer:_textContainer];
|
||||
|
||||
var caretOffset = [_layoutManager _characterOffsetAtLocation:_selectionRange.location inTextContainer:_textContainer],
|
||||
oldYPosition = CGRectGetMaxY(caretRect);
|
||||
var caretOffset = [_layoutManager _characterOffsetAtLocation:_selectionRange.location],
|
||||
oldYPosition = CGRectGetMaxY(caretRect),
|
||||
caretDescend = [_layoutManager _descentAtLocation:_selectionRange.location];
|
||||
|
||||
if (caretOffset > 0)
|
||||
{
|
||||
caretRect.origin.y += caretOffset;
|
||||
caretRect.size.height = oldYPosition - caretRect.origin.y;
|
||||
}
|
||||
if (caretDescend < 0)
|
||||
{
|
||||
caretRect.size.height -= caretDescend;
|
||||
}
|
||||
|
||||
caretRect.origin.x += _textContainerOrigin.x;
|
||||
caretRect.origin.y += _textContainerOrigin.y;
|
||||
|
||||
Reference in New Issue
Block a user