Revision: 12913
          http://sourceforge.net/p/skim-app/code/12913
Author:   hofman
Date:     2022-05-10 17:45:29 +0000 (Tue, 10 May 2022)
Log Message:
-----------
Take contentInsets into account for current page point

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

Modified: trunk/PDFView_SKExtensions.m
===================================================================
--- trunk/PDFView_SKExtensions.m        2022-05-10 17:36:33 UTC (rev 12912)
+++ trunk/PDFView_SKExtensions.m        2022-05-10 17:45:29 UTC (rev 12913)
@@ -209,8 +209,13 @@
 - (NSUInteger)currentPageIndexAndPoint:(NSPoint *)point rotated:(BOOL 
*)rotated {
     PDFPage *page = [self currentPage];
     // don't use currentDestination, as that always gives the top-left of the 
page in non-continuous mode, rather than the visible area
-    if (point) *point = [self convertPoint:SKTopLeftPoint([self bounds]) 
toPage:page];
-    if (rotated) *rotated = [page rotation] != [page intrinsicRotation];
+    if (point) {
+        NSPoint p = SKTopLeftPoint([self bounds]);
+        p.y -= [[self scrollView] contentInsets].top;
+        *point = [self convertPoint:p toPage:page];
+    }
+    if (rotated)
+        *rotated = [page rotation] != [page intrinsicRotation];
     return [page pageIndex];
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to