diff --git a/AppKit/CPCollectionView.j b/AppKit/CPCollectionView.j index 6efb2b2666..ddc353ce70 100644 --- a/AppKit/CPCollectionView.j +++ b/AppKit/CPCollectionView.j @@ -328,7 +328,7 @@ // either proportioned out to the views (if their minSize != maxSize) or used as // margin var itemSize = CGSizeMakeCopy(_minItemSize); - + _numberOfColumns = MAX(1.0, FLOOR(width / itemSize.width)); if (_maxNumberOfColumns > 0) @@ -340,6 +340,10 @@ if (remaining > 0 && itemSize.width < _maxItemSize.width) itemSize.width = MIN(_maxItemSize.width, itemSize.width + FLOOR(remaining / _numberOfColumns)); + // When we ONE column and a non-integral width, the FLOORing above can cause the item width to be smaller than the total width. + if (_maxNumberOfColumns == 1 && itemSize.width < _maxItemSize.width && itemSize.width < width) + itemSize.width = MIN(_maxItemSize.width, width); + if (!CGSizeEqualToSize(_itemSize, itemSize)) { _itemSize = itemSize; @@ -515,6 +519,7 @@ frame = [view frame]; [view setFrameSize:_itemSize]; + [view setAlphaValue:0.5]; [self dragView:view at:[[_items[[_selectionIndexes firstIndex]] view] frame].origin