prevent infinite recursion if width is NaN

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@37810 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2014-04-25 17:02:48 +00:00
parent a2c9a6f583
commit cf0a37304e

View file

@ -517,8 +517,8 @@ static NSString *placeholderItem = nil;
return;
CGFloat width = [self bounds].size.width;
NSLog(@"tile: width = %g, previous width = %g", width, _tileWidth);
if (ABS(width - _tileWidth) <= 2)
//NSLog(@"tile: width = %g, previous width = %g", width, _tileWidth);
if (isnan(width) || ABS(width - _tileWidth) <= 1)
return;
NSSize itemSize = NSMakeSize(_minItemSize.width, _minItemSize.height);
@ -587,7 +587,7 @@ static NSString *placeholderItem = nil;
NSSize currentSize = [self frame].size;
if (!NSEqualSizes(currentSize, aSize))
{
NSLog(@"resizeSubviews: new size = %g x %g, currentSize = %g x %g", aSize.width, aSize.height, currentSize.width, currentSize.height);
//NSLog(@"resizeSubviews: new size = %g x %g, currentSize = %g x %g", aSize.width, aSize.height, currentSize.width, currentSize.height);
[self tile];
}
}