From 57c8d223ad2b803ccc727143e3549d737cf43eea Mon Sep 17 00:00:00 2001 From: cacaodev Date: Wed, 29 Feb 2012 18:45:11 +0100 Subject: [PATCH] CPCollectionView dragging: fix a bug where the dragging view was created from content instead of selection --- AppKit/CPCollectionView.j | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AppKit/CPCollectionView.j b/AppKit/CPCollectionView.j index afeddba09..efa18e055 100644 --- a/AppKit/CPCollectionView.j +++ b/AppKit/CPCollectionView.j @@ -722,10 +722,11 @@ - (CPView)draggingViewForItemsAtIndexes:(CPIndexSet)indexes withEvent:(CPEvent)event offset:(CGPoint)dragImageOffset { + var idx = _content[[indexes firstIndex]]; if (!_itemForDragging) - _itemForDragging = [self newItemForRepresentedObject:_content[0]]; + _itemForDragging = [self newItemForRepresentedObject:idx]; else - [_itemForDragging setRepresentedObject:_content[[indexes firstIndex]]]; + [_itemForDragging setRepresentedObject:idx]; return [_itemForDragging view]; }