Revision: 9169 http://sourceforge.net/p/skim-app/code/9169 Author: hofman Date: 2016-10-12 13:59:50 +0000 (Wed, 12 Oct 2016) Log Message: ----------- check absolute scroll with margin in pdfview space up to one point
Modified Paths: -------------- trunk/PDFView_SKExtensions.m Modified: trunk/PDFView_SKExtensions.m =================================================================== --- trunk/PDFView_SKExtensions.m 2016-10-12 13:00:01 UTC (rev 9168) +++ trunk/PDFView_SKExtensions.m 2016-10-12 13:59:50 UTC (rev 9169) @@ -96,11 +96,12 @@ BOOL flipped = [clipView isFlipped]; CGFloat scroll = eventChar == NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey ? [scrollView verticalLineScroll] : NSHeight([self convertRect:clipRect fromView:clipView]) - 6.0 * [scrollView verticalPageScroll]; NSPoint point = [self convertPoint:clipRect.origin fromView:clipView]; + CGFloat margin = [self convertSize:NSMakeSize(1.0, 1.0) toView:clipView].height; if (eventChar == NSDownArrowFunctionKey || eventChar == NSPageDownFunctionKey) { point.y -= scroll; [clipView scrollPoint:[self convertPoint:point toView:clipView]]; - if ((flipped ? -1.0 : 1.0) * (NSMinY(clipRect) - NSMinY([clipView bounds])) <= 0.0 && [self canGoToNextPage]) { + if (fabs(NSMinY(clipRect) - NSMinY([clipView bounds])) <= margin && [self canGoToNextPage]) { [self goToNextPage:nil]; NSRect docRect = [[scrollView documentView] frame]; clipRect = [clipView bounds]; @@ -110,7 +111,7 @@ } else if (eventChar == NSUpArrowFunctionKey || eventChar == NSPageUpFunctionKey) { point.y += scroll; [clipView scrollPoint:[self convertPoint:point toView:clipView]]; - if ((flipped ? 1.0 : -1.0) * (NSMinY(clipRect) - NSMinY([clipView bounds])) <= 0.0 && [self canGoToPreviousPage]) { + if (fabs(NSMinY(clipRect) - NSMinY([clipView bounds])) <= margin && [self canGoToPreviousPage]) { [self goToPreviousPage:nil]; NSRect docRect = [[scrollView documentView] frame]; clipRect = [clipView bounds]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit