* Source/NSCollectionView.m (-drawRect:): Work around strange

behaviour of compiler.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38382 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2015-03-05 22:05:17 +00:00
parent a0e08ea59a
commit 896756ae92
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2015-03-05 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSCollectionView.m (-drawRect:): Work around strange
behaviour of compiler.
2015-03-05 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSImageView.m (-initWithFrame:): Set default for AllowsCutCopyPaste.

View file

@ -151,8 +151,11 @@ static NSString *placeholderItem = nil;
NSPoint oppositeOrigin = NSMakePoint (origin.x + size.width, origin.y + size.height);
NSInteger firstIndexInRect = MAX(0, [self _indexAtPoint: origin]);
NSInteger lastIndexInRect = MIN([_items count] - 1, [self _indexAtPoint: oppositeOrigin]);
NSInteger index;
// I had to extract these values from the macro to get it
// working correctly.
NSInteger index = [self _indexAtPoint: oppositeOrigin];
NSInteger last = [_items count] - 1;
NSInteger lastIndexInRect = MIN(last, index);
for (index = firstIndexInRect; index <= lastIndexInRect; index++)
{