Revision: 14292
http://sourceforge.net/p/skim-app/code/14292
Author: hofman
Date: 2024-06-03 09:24:05 +0000 (Mon, 03 Jun 2024)
Log Message:
-----------
Don't bother with display box for default thumbnail
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2024-06-03 08:55:05 UTC (rev 14291)
+++ trunk/SKMainWindowController.m 2024-06-03 09:24:05 UTC (rev 14292)
@@ -2850,14 +2850,12 @@
NSMutableArray *newThumbnails = [NSMutableArray array];
if ([pageLabels count] > 0) {
PDFPage *firstPage = [[pdfView document] pageAtIndex:0];
- PDFDisplayBox box = [pdfView displayBox];
- NSRect bounds = [firstPage boundsForBox:box];
+ NSRect bounds = [firstPage boundsForBox:[pdfView displayBox]];
if (([firstPage rotation] % 180) == 0)
bounds.origin = NSZeroPoint;
else
bounds = NSMakeRect(0.0, 0.0, NSHeight(bounds), NSWidth(bounds));
PDFPage *emptyPage = [[SKPDFPage alloc] init];
- [emptyPage setBounds:bounds forBox:kPDFDisplayBoxCropBox];
[emptyPage setBounds:bounds forBox:kPDFDisplayBoxMediaBox];
CGFloat width = ceil(0.8 * fmin(NSWidth(bounds), NSHeight(bounds)));
NSRect rect = NSInsetRect(bounds, 0.5 * (NSWidth(bounds) - width), 0.5
* (NSHeight(bounds) - width));
@@ -2879,7 +2877,7 @@
if ([[pdfView document] isLocked])
[stamps addObject:[[SKThumbnailStamp alloc]
initWithImage:[[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kLockedBadgeIcon)] rect:rect
fraction:0.5]];
- NSImage *pageImage = [emptyPage thumbnailWithSize:thumbnailCacheSize
forBox:box hasShadow:YES highlights:stamps];
+ NSImage *pageImage = [emptyPage thumbnailWithSize:thumbnailCacheSize
forBox:kPDFDisplayBoxMediaBox hasShadow:YES highlights:stamps];
[pageLabels enumerateObjectsUsingBlock:^(NSString *label, NSUInteger
i, BOOL *stop) {
SKThumbnail *thumbnail = [[SKThumbnail alloc]
initWithImage:pageImage label:label pageIndex:i];
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