Revision: 13784
          http://sourceforge.net/p/skim-app/code/13784
Author:   hofman
Date:     2023-11-20 14:49:41 +0000 (Mon, 20 Nov 2023)
Log Message:
-----------
fix scrolling workaround for non unit scaleFactor

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

Modified: trunk/PDFView_SKExtensions.m
===================================================================
--- trunk/PDFView_SKExtensions.m        2023-11-20 10:06:59 UTC (rev 13783)
+++ trunk/PDFView_SKExtensions.m        2023-11-20 14:49:41 UTC (rev 13784)
@@ -242,13 +242,14 @@
 - (void)goToPageAtIndex:(NSUInteger)pageIndex point:(NSPoint)point {
     PDFPage *page = [[self document] pageAtIndex:pageIndex];
     if (@available(macOS 12.0, *)) {
-        NSView *docView = [self documentView];
+        NSScrollView *scrollView = [self scrollView];
+        NSClipView *clipView = [scrollView contentView];
         if (NSLocationInRange(pageIndex, [self displayedPageIndexRange]) == NO)
             [self goToPage:page];
-        point = [self convertPoint:[self convertPoint:point fromPage:page] 
toView:docView];
-        if ([[[docView enclosingScrollView] contentView] isFlipped] == NO)
-            point.y -= [docView isFlipped] ? -NSHeight([docView visibleRect]) 
+ [[docView enclosingScrollView] contentInsets].top : NSHeight([docView 
visibleRect]) - [[docView enclosingScrollView] contentInsets].top;
-        [docView scrollPoint:point];
+        point = [self convertPoint:[self convertPoint:point fromPage:page] 
toView:clipView];
+        if ([clipView isFlipped] == NO)
+            point.y -= NSHeight([clipView visibleRect]) - [self 
convertSize:NSMakeSize(0.0, [scrollView contentInsets].top) 
toView:clipView].height;
+        [clipView scrollToPoint:point];
     } else {
         PDFDestination *destination = [[PDFDestination alloc] 
initWithPage:page atPoint:point];
         [self goToDestination:destination];

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