Revision: 12131
          http://sourceforge.net/p/skim-app/code/12131
Author:   hofman
Date:     2021-02-26 22:49:23 +0000 (Fri, 26 Feb 2021)
Log Message:
-----------
Round up scale to get integral size

Modified Paths:
--------------
    trunk/SKImageToolTipContext.m

Modified: trunk/SKImageToolTipContext.m
===================================================================
--- trunk/SKImageToolTipContext.m       2021-02-26 17:50:33 UTC (rev 12130)
+++ trunk/SKImageToolTipContext.m       2021-02-26 22:49:23 UTC (rev 12131)
@@ -107,7 +107,7 @@
     BOOL isScaled = fabs(scale - 1.0) > 0.01;
     PDFPage *page = [self page];
     NSRect bounds = [page boundsForBox:kPDFDisplayBoxCropBox];
-    CGFloat size = isScaled ? scale * fmax(NSWidth(bounds), NSHeight(bounds)) 
: 0.0;
+    CGFloat size = isScaled ? ceil(scale * fmax(NSWidth(bounds), 
NSHeight(bounds))) : 0.0;
     NSImage *pageImage = [page thumbnailWithSize:size 
forBox:kPDFDisplayBoxCropBox shadowBlurRadius:0.0 highlights:selections];
     NSRect pageImageRect = {NSZeroPoint, [pageImage size]};
     NSRect sourceRect = NSZeroRect;
@@ -115,7 +115,7 @@
     NSAffineTransform *transform = [page 
affineTransformForBox:kPDFDisplayBoxCropBox];
     if (isScaled) {
         NSAffineTransform *scaleTransform = [NSAffineTransform transform];
-        [scaleTransform scaleBy:scale];
+        [scaleTransform scaleBy:size / fmax(NSWidth(bounds), 
NSHeight(bounds))];
         [transform appendTransform:scaleTransform];
     }
     

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

Reply via email to