Revision: 13148
          http://sourceforge.net/p/skim-app/code/13148
Author:   hofman
Date:     2022-11-02 10:37:53 +0000 (Wed, 02 Nov 2022)
Log Message:
-----------
round off to pixels rather than shrink to pixels

Modified Paths:
--------------
    trunk/NSGeometry_SKExtensions.h
    trunk/SKPDFView.m

Modified: trunk/NSGeometry_SKExtensions.h
===================================================================
--- trunk/NSGeometry_SKExtensions.h     2022-11-01 23:28:23 UTC (rev 13147)
+++ trunk/NSGeometry_SKExtensions.h     2022-11-02 10:37:53 UTC (rev 13148)
@@ -141,10 +141,10 @@
 
 static inline NSRect SKIntegralRect(NSRect rect, CGFloat scale) {
     NSRect r;
-    r.origin.x = ceil(NSMinX(rect) * scale) / scale;
-    r.origin.y = ceil(NSMinY(rect) * scale) / scale;
-    r.size.width = floor(NSMaxX(rect) * scale) / scale - NSMinX(r);
-    r.size.height = floor(NSMaxY(rect) * scale) / scale - NSMinY(r);
+    r.origin.x = round(NSMinX(rect) * scale) / scale;
+    r.origin.y = round(NSMinY(rect) * scale) / scale;
+    r.size.width = round(NSMaxX(rect) * scale) / scale - NSMinX(r);
+    r.size.height = round(NSMaxY(rect) * scale) / scale - NSMinY(r);
     return NSWidth(r) > 0.0 && NSHeight(r) > 0.0 ? r : NSZeroRect;
 }
 

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2022-11-01 23:28:23 UTC (rev 13147)
+++ trunk/SKPDFView.m   2022-11-02 10:37:53 UTC (rev 13148)
@@ -4916,8 +4916,8 @@
                 [aShadow set];
                 NSRectFill(SKIntegralRect(pageRect, backingScale));
                 [NSGraphicsContext restoreGraphicsState];
-                [NSGraphicsContext saveGraphicsState];
                 if (RUNNING_AFTER(10_13) && aShadow) {
+                    [NSGraphicsContext saveGraphicsState];
                     [[NSColor colorWithGenericGamma22White:0.94 alpha:1.0] 
setFill];
                     NSFrameRectWithWidth(SKIntegralRect(pageRect, 
backingScale), magnification * scaleFactor);
                     [NSGraphicsContext restoreGraphicsState];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to