Ignore safe area for gallery content

This commit is contained in:
Shadowfacts 2024-03-29 22:06:28 -04:00
parent c05107bccd
commit 509ed305cd
1 changed files with 3 additions and 4 deletions

View File

@ -64,8 +64,7 @@ class GalleryItemViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let scrollView = UIScrollView()
self.scrollView = scrollView
scrollView = UIScrollView()
scrollView.translatesAutoresizingMaskIntoConstraints = false
scrollView.delegate = self
@ -288,8 +287,8 @@ class GalleryItemViewController: UIViewController {
return
}
let heightScale = view.safeAreaLayoutGuide.layoutFrame.height / content.contentSize.height
let widthScale = view.safeAreaLayoutGuide.layoutFrame.width / content.contentSize.width
let heightScale = view.bounds.height / content.contentSize.height
let widthScale = view.bounds.width / content.contentSize.width
let minScale = min(widthScale, heightScale)
let maxScale = minScale >= 1 ? minScale + 2 : 2