From 6d595c13449dbe9db644cd15531da37f8cb2d8c1 Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Sat, 24 Apr 2010 11:10:58 -0700 Subject: [PATCH] Collection view should tile itself to be the height of its superview if inside a clip view. --- AppKit/CPCollectionView.j | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/AppKit/CPCollectionView.j b/AppKit/CPCollectionView.j index 1f71f5876..77c4ca4d6 100644 --- a/AppKit/CPCollectionView.j +++ b/AppKit/CPCollectionView.j @@ -426,8 +426,17 @@ x += itemSize.width + _horizontalMargin; } + var superview = [self superview], + proposedHeight = y + itemSize.height + _verticalMargin; + + if ([superview isKindOfClass:[CPClipView class]]) + { + var superviewSize = [superview bounds].size; + proposedHeight = MAX(superviewSize.height, proposedHeight); + } + _tileWidth = width; - [self setFrameSize:CGSizeMake(width, y + itemSize.height + _verticalMargin)]; + [self setFrameSize:CGSizeMake(width, proposedHeight)]; _tileWidth = -1.0; }