Merge pull request #2135 from bdougsand/ipad-scrolling

Tweaks the scroll behavior when space bar is pressed
This commit is contained in:
Maurice Parker
2020-06-13 19:36:21 -05:00
committed by GitHub

View File

@@ -128,8 +128,9 @@ class WebViewController: UIViewController {
func scrollPageDown() {
guard let webView = webView else { return }
let overlap = 2 * UIFont.systemFont(ofSize: UIFont.systemFontSize).lineHeight * UIScreen.main.scale
let scrollToY: CGFloat = {
let fullScroll = webView.scrollView.contentOffset.y + webView.scrollView.layoutMarginsGuide.layoutFrame.height
let fullScroll = webView.scrollView.contentOffset.y + webView.scrollView.layoutMarginsGuide.layoutFrame.height - overlap
let final = finalScrollPosition()
return fullScroll < final ? fullScroll : final
}()