mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-16 13:31:18 +00:00
Merge pull request #2517 from daboe01/fix-initial-blinking-on-sheet
Fixed: caret did not blink in empty textview, e.g. when on freshly opened popover
This commit is contained in:
commit
249ebeb4aa
1 file changed
+3
-5
@@ -1959,7 +1959,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
- (void)updateInsertionPointStateAndRestartTimer:(BOOL)flag
|
||||
{
|
||||
var caretRect,
|
||||
numberOfGlyphs= [_layoutManager numberOfCharacters];
|
||||
numberOfGlyphs = [_layoutManager numberOfCharacters];
|
||||
|
||||
if (_selectionRange.length)
|
||||
[_caret setVisibility:NO];
|
||||
@@ -1970,10 +1970,10 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
|
||||
if (!numberOfGlyphs)
|
||||
{
|
||||
var font = [_typingAttributes objectForKey:CPFontAttributeName];
|
||||
var font = [_typingAttributes objectForKey:CPFontAttributeName] || [self font];
|
||||
|
||||
caretRect.size.height = [font size];
|
||||
caretRect.origin.y = ([font ascender] - [font descender]) * 0.5;
|
||||
caretRect.origin.y = ([font ascender] - [font descender]) * 0.5 + _textContainerOrigin.y;
|
||||
}
|
||||
|
||||
caretRect.origin.x += caretRect.size.width;
|
||||
@@ -1985,9 +1985,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
caretRect = [_layoutManager boundingRectForGlyphRange:CPMakeRange(_selectionRange.location, 1) inTextContainer:_textContainer];
|
||||
}
|
||||
|
||||
var loc = (_selectionRange.location === numberOfGlyphs && numberOfGlyphs > 0) ? _selectionRange.location - 1 : _selectionRange.location,
|
||||
caretOffset = [_layoutManager _characterOffsetAtLocation:loc],
|
||||
|
||||
Reference in new issue
Block a user