CPCollectionView dragging: fix a bug where the dragging view was created from content instead of selection

This commit is contained in:
cacaodev committed 2012-02-29 18:45:11 +01:00
1 parent 8641738777
commit 57c8d223ad
1 file changed
+3 -2
+3 -2
View File
@@ -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];
}