mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-24 00:58:53 +00:00
Merge remote-tracking branch 'upstream/main' into Aristo3
This commit is contained in:
commit
b9e734a21b
7 files changed
+1657
-201
No files matched your search
@@ -401,6 +401,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
- (void)superviewFrameChanged:(CPNotification)aNotification
|
||||
{
|
||||
_exposedRect = nil;
|
||||
[self sizeToFit];
|
||||
}
|
||||
|
||||
- (void)viewWillMoveToSuperview:(CPView)aView
|
||||
@@ -1402,7 +1403,10 @@ Sets the selection to a range of characters in response to user action.
|
||||
- (void)moveLeftAndModifySelection:(id)sender
|
||||
{
|
||||
if ([self isSelectable])
|
||||
{
|
||||
[self _extendSelectionIntoDirection:-1 granularity:CPSelectByCharacter];
|
||||
[self scrollRangeToVisible:_selectionRange];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)moveBackward:(id)sender
|
||||
@@ -1424,7 +1428,10 @@ Sets the selection to a range of characters in response to user action.
|
||||
- (void)moveLeft:(id)sender
|
||||
{
|
||||
if ([self isSelectable])
|
||||
{
|
||||
[self _establishSelection:CPMakeRange(_selectionRange.location - (_selectionRange.length ? 0 : 1), 0) byExtending:NO];
|
||||
[self scrollRangeToVisible:_selectionRange];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)moveToEndOfParagraph:(id)sender
|
||||
@@ -1658,7 +1665,10 @@ Sets the selection to a range of characters in response to user action.
|
||||
- (void)moveRight:(id)sender
|
||||
{
|
||||
if ([self isSelectable])
|
||||
{
|
||||
[self _establishSelection:CPMakeRange(CPMaxRange(_selectionRange) + (_selectionRange.length ? 0 : 1), 0) byExtending:NO];
|
||||
[self scrollRangeToVisible:_selectionRange];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_deleteForRange:(CPRange)changedRange
|
||||
@@ -2139,9 +2149,15 @@ Sets the selection to a range of characters in response to user action.
|
||||
if (CPEmptyRange(aRange))
|
||||
{
|
||||
if (aRange.location >= [_layoutManager numberOfCharacters])
|
||||
rect = [_layoutManager extraLineFragmentRect];
|
||||
{
|
||||
rect = CGRectCreateCopy([_layoutManager extraLineFragmentRect]);
|
||||
rect.size.width = 1.0;
|
||||
}
|
||||
else
|
||||
rect = [_layoutManager lineFragmentRectForGlyphAtIndex:aRange.location effectiveRange:nil];
|
||||
{
|
||||
rect = CGRectCreateCopy([_layoutManager boundingRectForGlyphRange:CPMakeRange(aRange.location, 1) inTextContainer:_textContainer]);
|
||||
rect.size.width = 1.0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2637,6 +2653,10 @@ var compareTabStops = function(obj1, obj2, context) {
|
||||
[_typingAttributes setObject:mutableStyle forKey:CPParagraphStyleAttributeName];
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPTextViewDidChangeTypingAttributesNotification object:self];
|
||||
}
|
||||
|
||||
[_layoutManager _validateLayoutAndGlyphs];
|
||||
[self sizeToFit];
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
- (void)rulerView:(CPRulerView)rulerView didRemoveMarker:(CPRulerMarker)marker
|
||||
@@ -2856,11 +2876,16 @@ var CPTextViewAllowsUndoKey = @"CPTextViewAllowsUndoKey",
|
||||
|
||||
_typingAttributes = [[_textStorage attributesAtIndex:0 effectiveRange:nil] copy];
|
||||
|
||||
if (!_typingAttributes)
|
||||
_typingAttributes = [CPMutableDictionary dictionary];
|
||||
|
||||
if (![_typingAttributes valueForKey:CPForegroundColorAttributeName])
|
||||
[_typingAttributes setObject:[CPColor blackColor] forKey:CPForegroundColorAttributeName];
|
||||
|
||||
_textColor = [_typingAttributes valueForKey:CPForegroundColorAttributeName];
|
||||
[self setFont:[_typingAttributes valueForKey:CPFontAttributeName]];
|
||||
|
||||
var decodedFont = [_typingAttributes valueForKey:CPFontAttributeName] || [CPFont systemFontOfSize:12.0];
|
||||
[self setFont:decodedFont];
|
||||
|
||||
[self setString:[_textStorage string]];
|
||||
|
||||
|
||||
Reference in new issue
Block a user