Revision: 13281
          http://sourceforge.net/p/skim-app/code/13281
Author:   hofman
Date:     2023-02-03 09:56:14 +0000 (Fri, 03 Feb 2023)
Log Message:
-----------
don't use super gotoPage. Don't scroll vertically when already on the requested 
page.

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

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2023-02-03 00:17:57 UTC (rev 13280)
+++ trunk/SKBasePDFView.m       2023-02-03 09:56:14 UTC (rev 13281)
@@ -298,7 +298,7 @@
     }
     pageBounds = [self convertRect:[self convertRect:pageBounds fromPage:page] 
toView:clipView];
     bounds.origin.x = fmin(fmax(fmin(NSMidX(pageBounds) - 0.5 * 
NSWidth(bounds), NSMinX(pageBounds)), NSMinX(docRect)), NSMaxX(docRect) - 
NSWidth(bounds));
-    [super goToPage:page];
+    [self goToPage:page];
     [clipView scrollToPoint:bounds.origin];
 }
 
@@ -306,7 +306,8 @@
     NSScrollView *scrollView = [self scrollView];
     CGFloat inset = [scrollView contentInsets].top;
     NSRect pageRect = [self convertRect:[page boundsForBox:[self displayBox]] 
fromPage:page];
-    if (NSMinY(pageRect) <= NSMidY([self bounds]) - 0.5 * inset)
+    CGFloat midY = NSMidY([self bounds]) - 0.5 * inset;
+    if (NSMinY(pageRect) <= midY && NSMaxY(pageRect) >= midY)
         return;
     NSClipView *clipView = [scrollView contentView];
     NSRect bounds = [clipView bounds];
@@ -389,7 +390,7 @@
     if (hasHorizontalLayout(self)) {
         [self horizontallyGoToPage:page];
     } else {
-        [super goToPage:page];
+        [self goToPage:page];
         if (hasVerticalLayout(self))
             [self verticallyGoToPage:page];
    }

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