Revision: 15703
http://sourceforge.net/p/skim-app/code/15703
Author: hofman
Date: 2025-10-24 18:07:24 +0000 (Fri, 24 Oct 2025)
Log Message:
-----------
use contentInsets from clipView, fix offset in flipped case
Modified Paths:
--------------
trunk/SKBasePDFView.m
Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m 2025-10-24 17:30:53 UTC (rev 15702)
+++ trunk/SKBasePDFView.m 2025-10-24 18:07:24 UTC (rev 15703)
@@ -268,12 +268,10 @@
- (void)verticallyScrollToTop {
NSScrollView *scrollView = [self scrollView];
- CGFloat inset = [scrollView contentInsets].top;
NSClipView *clipView = [scrollView contentView];
NSRect bounds = [clipView bounds];
- NSView *docView = [scrollView documentView];
- NSRect docRect = [docView convertRect:[docView bounds] toView:clipView];
- inset = [self convertSize:NSMakeSize(0.0, inset) toView:clipView].height;
+ CGFloat inset = [clipView contentInsets].top;
+ NSRect docRect = [[scrollView documentView] frame];
if (NSHeight(docRect) <= NSHeight(bounds) - inset)
return;
if ([clipView isFlipped])
@@ -286,16 +284,14 @@
- (void)verticallyScrollToBottom {
NSScrollView *scrollView = [self scrollView];
- CGFloat inset = [scrollView contentInsets].top;
NSClipView *clipView = [scrollView contentView];
NSRect bounds = [clipView bounds];
- NSView *docView = [scrollView documentView];
- NSRect docRect = [docView convertRect:[docView bounds] toView:clipView];
- inset = [self convertSize:NSMakeSize(0.0, inset) toView:clipView].height;
+ CGFloat inset = [clipView contentInsets].top;
+ NSRect docRect = [[scrollView documentView] frame];
if (NSHeight(docRect) <= NSHeight(bounds) - inset)
return;
if ([clipView isFlipped])
- bounds.origin.y = NSMaxY(docRect) - NSHeight(bounds) - inset;
+ bounds.origin.y = NSMaxY(docRect) - NSHeight(bounds);
else
bounds.origin.y = NSMinY(docRect);
[clipView scrollToPoint:bounds.origin];
@@ -412,7 +408,7 @@
} else if (([self displayMode] & kPDFDisplaySinglePageContinuous) == 0) {
page = [self currentPage];
}
-
+
// always call super, as it also updates the current page
[super scrollPageUp:sender];
@@ -433,7 +429,7 @@
NSRect bounds = NSZeroRect;
CGFloat top = 0.0;
PDFPage *page = nil;
-
+
// Apple scrolls by too much, so correct for it
if (hasVerticalLayout(self)) {
scrollView = [self scrollView];
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