Revision: 15941
          http://sourceforge.net/p/skim-app/code/15941
Author:   hofman
Date:     2026-01-02 10:24:09 +0000 (Fri, 02 Jan 2026)
Log Message:
-----------
take account of scrollview top inset for zoom to rect

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2026-01-02 10:13:24 UTC (rev 15940)
+++ trunk/SKPDFView.m   2026-01-02 10:24:09 UTC (rev 15941)
@@ -3035,9 +3035,11 @@
 
 - (void)zoomToRect:(NSRect)rect onPage:(PDFPage *)page {
     if (NSIsEmptyRect(rect) == NO) {
+        NSScrollView *scrollView = [self scrollView];
         CGFloat scrollerWidth = [NSScroller effectiveScrollerWidth];
         NSRect bounds = [self bounds];
         CGFloat scale = 1.0;
+        bounds.size.height -= [scrollView contentInsets].top;
         bounds.size.width -= scrollerWidth;
         bounds.size.height -= scrollerWidth;
         if (NSWidth(bounds) * NSHeight(rect) > NSWidth(rect) * 
NSHeight(bounds))
@@ -3045,7 +3047,6 @@
         else
             scale = NSWidth(bounds) / NSWidth(rect);
         [self setScaleFactor:scale];
-        NSScrollView *scrollView = [self scrollView];
         if (scrollerWidth > 0.0 && ([scrollView hasHorizontalScroller] == NO 
|| [scrollView hasVerticalScroller] == NO)) {
             if ([scrollView hasVerticalScroller])
                 bounds.size.width -= scrollerWidth;

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