Revision: 16643
          http://sourceforge.net/p/skim-app/code/16643
Author:   hofman
Date:     2026-10-10 17:00:32 +0000 (Sat, 10 Oct 2026)
Log Message:
-----------
pass different parameters

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

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2026-10-10 16:50:12 UTC (rev 16642)
+++ trunk/SKBasePDFView.m       2026-10-10 17:00:32 UTC (rev 16643)
@@ -308,12 +308,12 @@
     [scrollView reflectScrolledClipView:clipView];
 }
 
-- (void)scrollToPage:(PDFPage *)page mode:(PDFDisplayMode)mode {
+- (void)scrollToPage:(PDFPage *)page horizontally:(BOOL)horizontally 
vertically:(BOOL)vertically {
     NSScrollView *scrollView = [self embeddedScrollView];
     NSRect pageRect = [self convertRect:[page boundsForBox:[self displayBox]] 
fromPage:page];
     NSPoint center = SKCenterPoint([self bounds]);
-    BOOL vertically = (mode & kPDFDisplaySinglePageContinuous) && 
(NSMinY(pageRect) > center.y - 0.5 * [scrollView contentInsets].top || 
NSMaxY(pageRect) < center.y);
-    BOOL horizontally = (mode & kPDFDisplayTwoUp) && (NSMinX(pageRect) > 
center.x || NSMaxX(pageRect) < center.x);
+    vertically = vertically && (NSMinY(pageRect) > center.y - 0.5 * 
[scrollView contentInsets].top || NSMaxY(pageRect) < center.y);
+    horizontally = horizontally && (NSMinX(pageRect) > center.x || 
NSMaxX(pageRect) < center.x);
     if (vertically == NO && horizontally == NO)
         return;
     NSClipView *clipView = [scrollView contentView];
@@ -378,7 +378,7 @@
             --i;
         [super goToPreviousPage:sender];
         if (i-- > 0)
-            [self scrollToPage:[doc pageAtIndex:i] 
mode:kPDFDisplaySinglePageContinuous];
+            [self scrollToPage:[doc pageAtIndex:i] horizontally:NO 
vertically:YES];
     }
 }
 
@@ -396,7 +396,7 @@
             ++i;
         [super goToNextPage:sender];
         if (++i  < [doc pageCount])
-            [self scrollToPage:[doc pageAtIndex:i] 
mode:kPDFDisplaySinglePageContinuous];
+            [self scrollToPage:[doc pageAtIndex:i] horizontally:NO 
vertically:YES];
     }
 }
 
@@ -427,7 +427,7 @@
     } else {
         [self goToPage:page];
         if (displayMode != kPDFDisplaySinglePage)
-            [self scrollToPage:page mode:displayMode];
+            [self scrollToPage:page horizontally:(displayMode & 
kPDFDisplayTwoUp) != 0 vertically:(displayMode & 
kPDFDisplaySinglePageContinuous) != 0];
    }
 }
 
@@ -449,7 +449,7 @@
             [scrollView reflectScrolledClipView:clipView];
         }
     } else if ([self displayDirection] == kPDFDisplayDirectionVertical && 
([self displayMode] & kPDFDisplaySinglePageContinuous)) {
-        [self scrollToPage:page mode:kPDFDisplaySinglePageContinuous];
+        [self scrollToPage:page horizontally:NO vertically:YES];
     }
 }
 

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