Revision: 15207
http://sourceforge.net/p/skim-app/code/15207
Author: hofman
Date: 2025-05-13 21:44:48 +0000 (Tue, 13 May 2025)
Log Message:
-----------
calculate parameters outside block so we can use properties of self
Modified Paths:
--------------
trunk/SKPresentationView.m
Modified: trunk/SKPresentationView.m
===================================================================
--- trunk/SKPresentationView.m 2025-05-13 16:31:24 UTC (rev 15206)
+++ trunk/SKPresentationView.m 2025-05-13 21:44:48 UTC (rev 15207)
@@ -280,15 +280,14 @@
}
PDFPage *thePage = page;
- BOOL autoScales = [self autoScales];
-
+ NSRect pageRect = [page boundsForBox:kPDFDisplayBoxCropBox];
+ if (([page rotation] % 180) != 0)
+ pageRect = NSMakeRect(0.0, 0.0, NSHeight(pageRect), NSWidth(pageRect));
+ CGFloat scale = [self autoScales] ? fmin(NSHeight(bounds) /
NSHeight(pageRect), NSWidth(bounds) / NSWidth(pageRect)) : 1.0;
+ pageRect = NSInsetRect(bounds, 0.5 * (NSWidth(bounds) - scale *
NSWidth(pageRect)), 0.5 * (NSHeight(bounds) - scale * NSHeight(pageRect)));
+
dispatch_async(drawingQueue, ^{
- NSRect pageRect = [thePage boundsForBox:kPDFDisplayBoxCropBox];
- if (([thePage rotation] % 180) != 0)
- pageRect = NSMakeRect(0.0, 0.0, NSHeight(pageRect),
NSWidth(pageRect));
- CGFloat scale = autoScales ? fmin(NSHeight(bounds) /
NSHeight(pageRect), NSWidth(bounds) / NSWidth(pageRect)) : 1.0;
- pageRect = NSInsetRect(bounds, 0.5 * (NSWidth(bounds) - scale *
NSWidth(pageRect)), 0.5 * (NSHeight(bounds) - scale * NSHeight(pageRect)));
CGContextRef context = [[NSGraphicsContext
graphicsContextWithBitmapImageRep:imageRep] CGContext];
CGContextSaveGState(context);
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