mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-03 21:58:59 +00:00
AppKit: Fit a tracking text container inside the text view's inset
A text container that tracked its text view's size took the text view's full width, while the text started after the text container inset, so lines could run past the visible right edge. It now follows Cocoa: a tracking container fills the text view minus the inset on both sides. * CPTextView/CPTextContainer.j: Subtract the text container inset on both sides when tracking the text view's width and height. * CPTextView/CPTextView.j: Refit the text container when a text view is created and when its text container inset changes.
This commit is contained in:
1 parent
00851abfa9
commit
b4bff7ffe1
2 files changed
+12
-3
No files matched your search
@@ -210,6 +210,9 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
[self _init];
|
||||
[aContainer setTextView:self];
|
||||
|
||||
// Fit a container that tracks the text view's size inside the text container inset.
|
||||
[aContainer textViewFrameChanged:nil];
|
||||
|
||||
[self setEditable:YES];
|
||||
[self setSelectable:YES];
|
||||
[self setRichText:NO];
|
||||
@@ -812,6 +815,9 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
{
|
||||
_textContainerInset = aSize;
|
||||
[self invalidateTextContainerOrigin];
|
||||
|
||||
// A container that tracks the text view's size must shrink or grow with the new inset.
|
||||
[_textContainer textViewFrameChanged:nil];
|
||||
}
|
||||
|
||||
- (void)invalidateTextContainerOrigin
|
||||
|
||||
Reference in new issue
Block a user