Revision: 15995
          http://sourceforge.net/p/skim-app/code/15995
Author:   hofman
Date:     2026-01-10 17:30:24 +0000 (Sat, 10 Jan 2026)
Log Message:
-----------
make sure we take horizontal legacy scroller into account to scroll to the 
required page

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

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2026-01-10 16:58:13 UTC (rev 15994)
+++ trunk/SKBasePDFView.m       2026-01-10 17:30:24 UTC (rev 15995)
@@ -44,6 +44,7 @@
 #import "PDFAnnotation_SKExtensions.h"
 #import "PDFPage_SKExtensions.h"
 #import "PDFDestination_SKExtensions.h"
+#import "NSScroller_SKExtensions.h"
 
 #define SKNeverChangeZoomFromLinksKey @"SKNeverChangeZoomFromLinks"
 
@@ -261,13 +262,16 @@
     NSRect docRect = [[scrollView documentView] frame];
     CGFloat margin = 0.0;
     CGFloat inset = [clipView contentInsets].top;
+    CGFloat scrollerWidth = 0.0;
     if ([pdfView displaysPageBreaks])
         margin = [pdfView convertSize:NSMakeSize(0.0, [pdfView 
pageBreakMargins].top * [pdfView scaleFactor]) toView:clipView].height;
+    if ([scrollView hasHorizontalScroller])
+        scrollerWidth = [pdfView convertSize:NSMakeSize(0.0, [NSScroller 
effectiveScrollerWidth]) toView:clipView].height;
     pageRect = [pdfView convertRect:pageRect toView:clipView];
     if ([clipView isFlipped])
-        bounds.origin.y = fmin(fmax(fmin(NSMaxY(pageRect) - 0.5 * 
(NSHeight(bounds) + inset), NSMinY(pageRect) - margin - inset), NSMinY(docRect) 
- inset), NSMaxY(docRect) - NSHeight(bounds));
+        bounds.origin.y = fmin(fmax(fmin(NSMaxY(pageRect) - 0.5 * 
(NSHeight(bounds) + fmax(scrollerWidth, inset)), NSMinY(pageRect) - margin - 
inset), NSMinY(docRect) - inset), NSMaxY(docRect) - NSHeight(bounds));
     else
-        bounds.origin.y = fmin(fmax(fmax(NSMinY(pageRect) - 0.5 * 
(NSHeight(bounds) - inset), NSMaxY(pageRect) + margin - NSHeight(bounds) + 
inset), NSMinY(docRect)), NSMaxY(docRect) - NSHeight(bounds) + inset);
+        bounds.origin.y = fmin(fmax(fmax(NSMinY(pageRect) - 0.5 * 
(NSHeight(bounds) - fmax(scrollerWidth, inset)), NSMaxY(pageRect) + margin - 
NSHeight(bounds) + inset), NSMinY(docRect)), NSMaxY(docRect) - NSHeight(bounds) 
+ inset);
     [clipView scrollPoint:bounds.origin];
 }
 

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