(-setConstrainedFrameSize:):Fix calculation of effective minimum size. (-sizeToFit): Use maximum x and y of used rect to calculate size, not used rect's own size.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15753 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-01-28 22:32:18 +00:00
parent 36c596fdf6
commit e9ebe98664
2 changed files with 15 additions and 4 deletions

View file

@ -1,3 +1,11 @@
2003-01-28 23:29 Alexander Malmberg <alexander@malmberg.org>
* Source/NSTextView.m (-setConstrainedFrameSize:) Fix calculation of
the effective minimum size.
(-sizeToFit): Use maximum x and y of used rect to calculate size, not
the used rect's own size.
2003-01-28 22:54 Alexander Malmberg <alexander@malmberg.org>
* Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength:

View file

@ -1327,7 +1327,10 @@ incorrectly. */
return;
if (_tf.is_horizontally_resizable || _tf.is_vertically_resizable)
size = [_layoutManager usedRectForTextContainer: _textContainer].size;
{
NSRect r = [_layoutManager usedRectForTextContainer: _textContainer];
size = NSMakeSize(NSMaxX(r), NSMaxY(r));
}
if (!_tf.is_horizontally_resizable)
size.width = _bounds.size.width;
@ -1353,8 +1356,8 @@ incorrectly. */
[cv documentView] == self)
{
NSSize b = [cv bounds].size;
effectiveMinSize.width = MIN(effectiveMinSize.width , b.width );
effectiveMinSize.height = MIN(effectiveMinSize.height, b.height);
effectiveMinSize.width = MAX(effectiveMinSize.width , b.width );
effectiveMinSize.height = MAX(effectiveMinSize.height, b.height);
}
if (_tf.is_horizontally_resizable)
@ -1378,7 +1381,7 @@ incorrectly. */
{
newSize.height = _frame.size.height;
}
if (NSEqualSizes(_frame.size, newSize) == NO)
{
[self setFrameSize: newSize];