Actually fix multi-column nav scrolling animations this time (hopefully)

Closes #539
This commit is contained in:
Shadowfacts 2024-09-09 19:35:15 -04:00
parent f9c0506590
commit 506d2ad8a9
1 changed files with 2 additions and 2 deletions

View File

@ -152,10 +152,10 @@ class MultiColumnNavigationController: UIViewController {
let column = stackView.arrangedSubviews[columnIndex] let column = stackView.arrangedSubviews[columnIndex]
let columnFrame = column.convert(column.bounds, to: scrollView) let columnFrame = column.convert(column.bounds, to: scrollView)
let offset: CGFloat let offset: CGFloat
if columnFrame.maxX < scrollView.bounds.width - scrollView.adjustedTrailingContentInset { if columnFrame.maxX <= view.bounds.width - view.safeAreaInsets.left - view.safeAreaInsets.right - scrollView.adjustedTrailingContentInset {
offset = -scrollView.adjustedLeadingContentInset offset = -scrollView.adjustedLeadingContentInset
} else { } else {
offset = scrollView.contentSize.width - scrollView.bounds.width + scrollView.adjustedTrailingContentInset offset = columnFrame.maxX - scrollView.bounds.width + scrollView.adjustedTrailingContentInset
} }
scrollView.setContentOffset(CGPoint(x: offset, y: -scrollView.adjustedContentInset.top), animated: animated) scrollView.setContentOffset(CGPoint(x: offset, y: -scrollView.adjustedContentInset.top), animated: animated)
} }