Adjust the minimum and maximum sizes of a NSTextView to ensure that

the minimum size is not greater than the current size and the maximum
size is not smaller than the current size.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34362 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2011-12-29 16:48:17 +00:00
parent bf52affd57
commit 1c792c4b66
2 changed files with 23 additions and 0 deletions

View file

@ -1994,6 +1994,22 @@ before this TODO can be removed
}
}
- (void) resizeSubviewsWithOldSize: (NSSize)oldSize
{
NSSize curSize = [self frame].size;
if (_minSize.width > curSize.width)
_minSize.width = curSize.width;
if (_minSize.height > curSize.height)
_minSize.height = curSize.height;
if (_maxSize.width < curSize.width)
_maxSize.width = curSize.width;
if (_maxSize.height < curSize.height)
_maxSize.height = curSize.height;
[super resizeSubviewsWithOldSize: oldSize];
}
/**** Text container origin ****/