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:
Wolfgang Lux 2011-12-29 16:48:17 +00:00
parent a91a93939d
commit 0da1b1f034
2 changed files with 23 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2011-12-29 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSTextView.m (-resizeSubviewsWithOldSize:): Adjust
minimum and maximum sizes to ensure that the minimum size is not
greater than the current size and the maximum size is not smaller
than the current size.
2011-12-27 German Arias <german@xelalug.org>
* Resources/Spanish.lproj/Localizable.strings: Update.

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 ****/