Merge pull request #841 from kiwix/839-content-default-positioning-is-not-always-correct

Remove default zoomScale, that causes wrong content adjustment
This commit is contained in:
Kelson 2024-07-01 02:04:26 +02:00 committed by GitHub
commit be94bf8a97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,7 +97,6 @@ final class WebViewController: UIViewController {
It appears the webview's state restoration does not properly take into account of the content inset.
To mitigate, first pin the webview's top against safe area top anchor, after all viewDidLayoutSubviews calls,
pin the webview's top against view's top anchor, so that content does not appears to move up.
HACK: when view resize, the webview might become zoomed in. To mitigate, set zoom scale to 1.
*/
NSLayoutConstraint.activate([
view.leftAnchor.constraint(equalTo: webView.leftAnchor),
@ -113,7 +112,6 @@ final class WebViewController: UIViewController {
let webView = self?.webView,
view.subviews.contains(webView) else { return }
webView.alpha = 1
webView.scrollView.zoomScale = 1
guard self?.topSafeAreaConstraint?.isActive == true else { return }
self?.topSafeAreaConstraint?.isActive = false
self?.view.topAnchor.constraint(equalTo: webView.topAnchor).isActive = true