Revision: 13922
http://sourceforge.net/p/skim-app/code/13922
Author: hofman
Date: 2023-12-18 18:44:54 +0000 (Mon, 18 Dec 2023)
Log Message:
-----------
don't try to insert image components for items not yet displayed
Modified Paths:
--------------
trunk/SKThumbnailView.m
Modified: trunk/SKThumbnailView.m
===================================================================
--- trunk/SKThumbnailView.m 2023-12-18 18:36:54 UTC (rev 13921)
+++ trunk/SKThumbnailView.m 2023-12-18 18:44:54 UTC (rev 13922)
@@ -458,13 +458,15 @@
__block NSInteger offset = -(NSInteger)[selectionIndexes
countOfIndexesInRange:NSMakeRange(0, pageIndex)];
[selectionIndexes enumerateIndexesUsingBlock:^(NSUInteger
idx, BOOL *stop){
NSDraggingImageComponent *component =
[(SKThumbnailView *)[[collectionView itemAtIndexPath:[NSIndexPath
indexPathForItem:idx inSection:0]] view] draggingImageComponent];
- NSRect rect = [component frame];
- rect.origin.x += offset * COMPONENT_OFFSET_X;
- rect.origin.y += offset * COMPONENT_OFFSET_Y;
- [component setFrame:rect];
- if (offset)
- [component setKey:[NSString
stringWithFormat:@"%@%ld", [component key], offset]];
- [components insertObject:component atIndex:0];
+ if (component) {
+ NSRect rect = [component frame];
+ rect.origin.x += offset * COMPONENT_OFFSET_X;
+ rect.origin.y += offset * COMPONENT_OFFSET_Y;
+ [component setFrame:rect];
+ if (offset)
+ [component setKey:[NSString
stringWithFormat:@"%@%ld", [component key], offset]];
+ [components insertObject:component atIndex:0];
+ }
++offset;
}];
return components;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit