From 351efe4b58d7a33c7fc7a893d605df22dca3255e Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 25 Nov 2024 20:40:13 -0500 Subject: [PATCH] Fix gallery content scrolling unnecessarily in certain circumstances --- .../Sources/GalleryVC/GalleryItemViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift b/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift index b41f7397..3c5df912 100644 --- a/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift +++ b/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift @@ -69,6 +69,10 @@ class GalleryItemViewController: UIViewController { scrollView = UIScrollView() scrollView.translatesAutoresizingMaskIntoConstraints = false scrollView.delegate = self + // We calculate zoom/position ignoring the safe area, so content insets need to not incorporate it either. + // Otherwise, content that fills the screen (extending into the safe area) may still end up scrollable + // (this is readily observable with tall images on a landscape iPad). + scrollView.contentInsetAdjustmentBehavior = .never view.addSubview(scrollView)