Revision: 16649
          http://sourceforge.net/p/skim-app/code/16649
Author:   hofman
Date:     2026-10-11 17:09:03 +0000 (Sun, 11 Oct 2026)
Log Message:
-----------
combine cases

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

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2026-10-11 17:02:33 UTC (rev 16648)
+++ trunk/SKBasePDFView.m       2026-10-11 17:09:03 UTC (rev 16649)
@@ -530,27 +530,21 @@
     } else if (pageIndex != NSNotFound) {
         // check whether we jumped pages
         NSUInteger currentPageIndex = [[self currentPage] pageIndex];
-        if (currentPageIndex > pageIndex) {
-            [self verticallyScrollToTop:YES];
-        } else if (currentPageIndex < pageIndex) {
-            [self verticallyScrollToTop:NO];
+        if (currentPageIndex != pageIndex) {
+            [self verticallyScrollToTop:currentPageIndex > pageIndex];
         } else if (clipView && NSEqualPoints([clipView bounds].origin, 
bounds.origin)) {
-            if (keyDirection == 1) {
+            if (keyDirection == 1)
                 [super goToNextPage:sender];
-                [self verticallyScrollToTop:YES];
-            } else {
+            else
                 [super goToPreviousPage:sender];
-                [self verticallyScrollToTop:NO];
-            }
+            [self verticallyScrollToTop:keyDirection == 1];
         }
     } else if (clipView && NSEqualPoints([clipView bounds].origin, 
bounds.origin)) {
-        if (keyDirection == 1) {
+        if (keyDirection == 1)
             [self goToNextPage:sender];
-            [self verticallyScrollToTop:YES];
-        } else {
+        else
             [self goToPreviousPage:sender];
-            [self verticallyScrollToTop:NO];
-        }
+        [self verticallyScrollToTop:keyDirection == 1];
     }
 }
 
@@ -604,27 +598,21 @@
     } else if (pageIndex != NSNotFound) {
         // check whether we jumped pages
         NSUInteger currentPageIndex = [[self currentPage] pageIndex];
-        if (currentPageIndex < pageIndex) {
-            [self verticallyScrollToTop:NO];
-        } else if (currentPageIndex > pageIndex) {
-            [self verticallyScrollToTop:YES];
+        if (currentPageIndex != pageIndex) {
+            [self verticallyScrollToTop:currentPageIndex > pageIndex];
         } else if (clipView && NSEqualPoints([clipView bounds].origin, 
bounds.origin)) {
-            if (keyDirection == -1) {
+            if (keyDirection == -1)
                 [super goToPreviousPage:sender];
-                [self verticallyScrollToTop:NO];
-            } else {
+            else
                 [super goToNextPage:sender];
-                [self verticallyScrollToTop:YES];
-            }
+            [self verticallyScrollToTop:keyDirection == 1];
         }
     } else if (clipView && NSEqualPoints([clipView bounds].origin, 
bounds.origin)) {
-        if (keyDirection == -1) {
+        if (keyDirection == -1)
             [self goToPreviousPage:sender];
-            [self verticallyScrollToTop:NO];
-        } else {
+        else
             [self goToNextPage:sender];
-            [self verticallyScrollToTop:YES];
-        }
+        [self verticallyScrollToTop:keyDirection == 1];
     }
 }
 
@@ -637,10 +625,8 @@
         // Apple scrolls to the bottom of the next page rather than the top
         // check whether we jumped pages
         NSUInteger currentPageIndex = [[self currentPage] pageIndex];
-        if (currentPageIndex > pageIndex)
-            [self verticallyScrollToTop:YES];
-        else if (currentPageIndex < pageIndex)
-            [self verticallyScrollToTop:NO];
+        if (currentPageIndex != pageIndex)
+            [self verticallyScrollToTop:currentPageIndex > pageIndex];
     }
 }
 
@@ -653,10 +639,8 @@
         // Apple scrolls to the top of the next page rather than the bottom
         // check whether we jumped pages
         NSUInteger currentPageIndex = [[self currentPage] pageIndex];
-        if (currentPageIndex < pageIndex)
-            [self verticallyScrollToTop:NO];
-        else if (currentPageIndex > pageIndex)
-            [self verticallyScrollToTop:YES];
+        if (currentPageIndex != pageIndex)
+            [self verticallyScrollToTop:currentPageIndex > pageIndex];
     }
 }
 

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