Revision: 15706
          http://sourceforge.net/p/skim-app/code/15706
Author:   hofman
Date:     2025-10-24 22:13:00 +0000 (Fri, 24 Oct 2025)
Log Message:
-----------
get limits only when they are needed, get them from documentview framr

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

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2025-10-24 22:04:20 UTC (rev 15705)
+++ trunk/SKBasePDFView.m       2025-10-24 22:13:00 UTC (rev 15706)
@@ -395,7 +395,6 @@
     NSScrollView *scrollView;
     NSClipView *clipView = nil;
     NSRect bounds = NSZeroRect;
-    CGFloat bottom = 0.0;
     PDFPage *page = nil;
     
     // Apple scrolls by too much, so correct for it
@@ -403,8 +402,6 @@
         scrollView = [self scrollView];
         clipView = [[self scrollView] contentView];
         bounds = [clipView bounds];
-        NSView *docView = [self documentView];
-        bottom = NSMinY([docView convertRect:[docView bounds] 
toView:clipView]);
     } else if (([self displayMode] & kPDFDisplaySinglePageContinuous) == 0) {
         page = [self currentPage];
     }
@@ -415,6 +412,7 @@
     // check whether our assumptions are still correct
     if (clipView && [clipView isFlipped] == NO && NSMinY([clipView bounds]) < 
NSMinY(bounds)) {
         CGFloat height = NSHeight(bounds) - [clipView contentInsets].top;
+        CGFloat bottom = NSMinY([[scrollView documentView] frame]);
         bounds.origin.y = fmax(bottom, NSMinY(bounds) - (height < 10.0 ? 
height : height < 20.0 ? 10.0 : height - 10.0));
         [clipView scrollToPoint:bounds.origin];
         [scrollView reflectScrolledClipView:clipView];
@@ -429,7 +427,6 @@
     NSScrollView *scrollView;
     NSClipView *clipView = nil;
     NSRect bounds = NSZeroRect;
-    CGFloat top = 0.0;
     PDFPage *page = nil;
     
     // Apple scrolls by too much, so correct for it
@@ -437,8 +434,6 @@
         scrollView = [self scrollView];
         clipView = [scrollView contentView];
         bounds = [clipView bounds];
-        NSView *docView = [self documentView];
-        top = NSMaxY([docView convertRect:[docView bounds] toView:clipView]);
     } else if (([self displayMode] & kPDFDisplaySinglePageContinuous) == 0) {
         page = [self currentPage];
     }
@@ -449,6 +444,7 @@
     // check whether our assumptions are still correct
     if (clipView && [clipView isFlipped] == NO && NSMinY([clipView bounds]) > 
NSMinY(bounds)) {
         CGFloat height = NSHeight(bounds) - [clipView contentInsets].top;
+        CGFloat top = NSMaxY([[scrollView documentView] frame]);
         bounds.origin.y = fmin(top - height, NSMinY(bounds) + (height < 10.0 ? 
height : height < 20.0 ? 10.0 : height - 10.0));
         [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