mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-15 15:11:28 +00:00
size should not be smaller than clipview
This commit is contained in:
@@ -1465,7 +1465,12 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
var minSize = [self minSize],
|
||||
maxSize = [self maxSize],
|
||||
desiredSize = aSize,
|
||||
rect = [_layoutManager boundingRectForGlyphRange:CPMakeRange(0, MAX(0, [_layoutManager numberOfCharacters] - 1)) inTextContainer:_textContainer];
|
||||
rect = [_layoutManager boundingRectForGlyphRange:CPMakeRange(0, MAX(0, [_layoutManager numberOfCharacters] - 1)) inTextContainer:_textContainer],
|
||||
myClipviewSize = nil;
|
||||
|
||||
if ([[self superview] isKindOfClass:[CPClipView class]])
|
||||
myClipviewSize = [[self superview] frame].size;
|
||||
|
||||
|
||||
if ([_layoutManager extraLineFragmentTextContainer] === _textContainer)
|
||||
rect = CGRectUnion(rect, [_layoutManager extraLineFragmentRect]);
|
||||
@@ -1490,6 +1495,14 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
desiredSize.height = maxSize.height;
|
||||
}
|
||||
|
||||
if (myClipviewSize)
|
||||
{
|
||||
if (desiredSize.width < myClipviewSize.width)
|
||||
desiredSize.width = myClipviewSize.width;
|
||||
if (desiredSize.height < myClipviewSize.height)
|
||||
desiredSize.height = myClipviewSize.height;
|
||||
}
|
||||
|
||||
[super setFrameSize:desiredSize];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user