Revision: 16010
          http://sourceforge.net/p/skim-app/code/16010
Author:   hofman
Date:     2026-01-13 16:09:05 +0000 (Tue, 13 Jan 2026)
Log Message:
-----------
use scrollToPoint: instead of scrollPoint: to correct scrolling to avoid 
animating the scrolling

Modified Paths:
--------------
    trunk/PDFView_SKExtensions.m
    trunk/SKBasePDFView.m
    trunk/SKMainWindowController_Actions.m
    trunk/SKPDFView.m

Modified: trunk/PDFView_SKExtensions.m
===================================================================
--- trunk/PDFView_SKExtensions.m        2026-01-12 18:05:46 UTC (rev 16009)
+++ trunk/PDFView_SKExtensions.m        2026-01-13 16:09:05 UTC (rev 16010)
@@ -135,8 +135,9 @@
 }
 
 - (void)doDragContentWithEvent:(NSEvent *)theEvent {
-    NSView *contentView = [[self embeddedScrollView] contentView];
-    NSPoint startLocation = [contentView convertPoint:[theEvent 
locationInWindow] fromView:nil];
+    NSScrollView *scrollView = [self embeddedScrollView];
+    NSClipView *clipView = [scrollView contentView];
+    NSPoint startLocation = [clipView convertPoint:[theEvent locationInWindow] 
fromView:nil];
        
     [[NSCursor closedHandCursor] push];
     
@@ -147,10 +148,11 @@
             break;
         
         // convert takes flipping and scaling into account
-        NSPoint        newLocation = [contentView convertPoint:[theEvent 
locationInWindow] fromView:nil];
-        NSPoint        point = SKAddPoints([contentView bounds].origin, 
SKSubstractPoints(startLocation, newLocation));
+        NSPoint        newLocation = [clipView convertPoint:[theEvent 
locationInWindow] fromView:nil];
+        NSPoint        point = SKAddPoints([clipView bounds].origin, 
SKSubstractPoints(startLocation, newLocation));
         
-        [contentView scrollPoint:point];
+        [clipView scrollToPoint:point];
+        [scrollView reflectScrolledClipView:clipView];
        }
     
     [NSCursor pop];
@@ -220,7 +222,8 @@
             dest.point = [self convertPoint:[self convertPoint:dest.point 
fromPage:page] toView:clipView];
             if ([clipView isFlipped] == NO)
                 dest.point.y -= NSHeight([clipView visibleRect]) - [clipView 
contentInsets].top;
-            [clipView scrollPoint:dest.point];
+            [clipView scrollToPoint:dest.point];
+            [scrollView reflectScrolledClipView:clipView];
         }
     }
 }

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2026-01-12 18:05:46 UTC (rev 16009)
+++ trunk/SKBasePDFView.m       2026-01-13 16:09:05 UTC (rev 16010)
@@ -240,7 +240,8 @@
         margin = [self pageBreakMargins].left;
     bounds.origin.x = fmin(fmax(fmin(NSMidX(pageBounds) - 0.5 * 
NSWidth(bounds), NSMinX(pageBounds) - margin), NSMinX(docRect)), 
NSMaxX(docRect) - NSWidth(bounds));
     [self goToPage:page];
-    [clipView scrollPoint:bounds.origin];
+    [clipView scrollToPoint:bounds.origin];
+    [scrollView reflectScrolledClipView:clipView];
 }
 
 - (void)scrollToPage:(PDFPage *)page mode:(PDFDisplayMode)mode {
@@ -278,7 +279,8 @@
             margin = [self pageBreakMargins].left;
         bounds.origin.x = fmin(NSMinX(pageRect) - margin, NSMaxX(docRect) - 
NSWidth(bounds));
     }
-    [clipView scrollPoint:bounds.origin];
+    [clipView scrollToPoint:bounds.origin];
+    [scrollView reflectScrolledClipView:clipView];
 }
 
 - (void)verticallyScrollToTop {
@@ -293,7 +295,8 @@
         bounds.origin.y = NSMinY(docRect) - inset;
     else
         bounds.origin.y = NSMaxY(docRect) - NSHeight(bounds) + inset;
-    [clipView scrollPoint:bounds.origin];
+    [clipView scrollToPoint:bounds.origin];
+    [scrollView reflectScrolledClipView:clipView];
 }
 
 - (void)verticallyScrollToBottom {
@@ -308,7 +311,8 @@
         bounds.origin.y = NSMaxY(docRect) - NSHeight(bounds);
     else
         bounds.origin.y = NSMinY(docRect);
-    [clipView scrollPoint:bounds.origin];
+    [clipView scrollToPoint:bounds.origin];
+    [scrollView reflectScrolledClipView:clipView];
 }
 
 - (void)goToPreviousPage:(id)sender {
@@ -388,7 +392,8 @@
             dest.point.y -= [clipView contentInsets].top;
         else
             dest.point.y -= NSHeight([clipView bounds]) - [clipView 
contentInsets].top;
-        [clipView scrollPoint:dest.point];
+        [clipView scrollToPoint:dest.point];
+        [scrollView reflectScrolledClipView:clipView];
     } else if ([self displayDirection] == kPDFDisplayDirectionVertical && 
([self displayMode] & kPDFDisplaySinglePageContinuous)) {
         [self scrollToPage:page mode:kPDFDisplaySinglePageContinuous];
     }
@@ -455,7 +460,8 @@
             bounds.origin.y = fmin(NSMaxY([[scrollView documentView] frame]) - 
height - inset, NSMinY(bounds) + offset);
         else
             return;
-        [clipView scrollPoint:bounds.origin];
+        [clipView scrollToPoint:bounds.origin];
+        [scrollView reflectScrolledClipView:clipView];
     } else if (pageIndex != NSNotFound) {
         // check whether we jumped pages
         NSUInteger currentPageIndex = [[self currentPage] pageIndex];
@@ -512,7 +518,8 @@
             bounds.origin.y = fmax(NSMinY([[scrollView documentView] frame]) - 
inset, NSMinY(bounds) - offset);
         else
             return;
-        [clipView scrollPoint:bounds.origin];
+        [clipView scrollToPoint:bounds.origin];
+        [scrollView reflectScrolledClipView:clipView];
     } else if (pageIndex != NSNotFound) {
         // check whether we jumped pages
         NSUInteger currentPageIndex = [[self currentPage] pageIndex];

Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m      2026-01-12 18:05:46 UTC (rev 
16009)
+++ trunk/SKMainWindowController_Actions.m      2026-01-13 16:09:05 UTC (rev 
16010)
@@ -1135,9 +1135,11 @@
             page = [pdfView pageForPoint:point nearest:YES];
             [secondaryPdfView goToPage:page];
             [secondaryPdfView layoutDocumentView];
-            NSClipView *clipView = [[secondaryPdfView embeddedScrollView] 
contentView];
+            NSScrollView *scrollView = [secondaryPdfView embeddedScrollView];
+            NSClipView *clipView = [scrollView contentView];
             point = [secondaryPdfView convertPoint:[secondaryPdfView 
convertPoint:[pdfView convertPoint:point toPage:page] fromPage:page] 
toView:clipView];
-            [clipView scrollPoint:point];
+            [clipView scrollToPoint:point];
+            [scrollView reflectScrolledClipView:clipView];
             [secondaryPdfView resetHistory];
             
         } else {

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2026-01-12 18:05:46 UTC (rev 16009)
+++ trunk/SKPDFView.m   2026-01-13 16:09:05 UTC (rev 16010)
@@ -1027,7 +1027,8 @@
             bounds.origin.y = NSMinY(docRect);
     }
     if (NSEqualPoints(bounds.origin, currentOrigin) == NO) {
-        [clipView scrollPoint:bounds.origin];
+        [clipView scrollToPoint:bounds.origin];
+        [scrollView reflectScrolledClipView:clipView];
     }
 }
 
@@ -1527,7 +1528,8 @@
             else
                 bounds.origin.y = fmax(fmin(fmax(NSMidY(pageRect) - 0.5 * 
(NSHeight(bounds) - inset), NSMaxY(pageRect) + margin - NSHeight(bounds) + 
inset), NSMaxY(docRect) - NSHeight(bounds) + inset), NSMinY(docRect));
         }
-        [clipView scrollPoint:bounds.origin];
+        [clipView scrollToPoint:bounds.origin];
+        [scrollView reflectScrolledClipView:clipView];
     }
 }
 

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