mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Fixes incorrect corner radius animation for AppViewController + HeaderContentViewController
This commit is contained in:
@@ -266,7 +266,18 @@ final class AppViewController: UIViewController
|
|||||||
}
|
}
|
||||||
|
|
||||||
let difference = self.scrollView.contentOffset.y - showNavigationBarThreshold
|
let difference = self.scrollView.contentOffset.y - showNavigationBarThreshold
|
||||||
let range = (headerFrame.height + padding) - (self.navigationController?.navigationBar.bounds.height ?? self.view.safeAreaInsets.top)
|
|
||||||
|
let range: Double
|
||||||
|
if self.presentingViewController == nil && self.parent?.presentingViewController == nil
|
||||||
|
{
|
||||||
|
// Not presented modally, so rely on safe area + navigation bar height.
|
||||||
|
range = (headerFrame.height + padding) - (self.navigationController?.navigationBar.bounds.height ?? self.view.safeAreaInsets.top)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Presented modally, so rely on maximumContentY.
|
||||||
|
range = maximumContentY - (maximumContentY - padding - headerFrame.height) - inset
|
||||||
|
}
|
||||||
|
|
||||||
let fractionComplete = min(difference, range) / range
|
let fractionComplete = min(difference, range) / range
|
||||||
self.navigationBarAnimator?.fractionComplete = fractionComplete
|
self.navigationBarAnimator?.fractionComplete = fractionComplete
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ class HeaderContentViewController<Header: UIView, Content: ScrollableContentView
|
|||||||
{
|
{
|
||||||
statusBarHeight = 20
|
statusBarHeight = 20
|
||||||
}
|
}
|
||||||
else if let statusBarManager = self.view.window?.windowScene?.statusBarManager
|
else if let statusBarManager = (self.view.window ?? self.presentedViewController?.view.window)?.windowScene?.statusBarManager
|
||||||
{
|
{
|
||||||
statusBarHeight = statusBarManager.statusBarFrame.height
|
statusBarHeight = statusBarManager.statusBarFrame.height
|
||||||
}
|
}
|
||||||
@@ -347,7 +347,18 @@ class HeaderContentViewController<Header: UIView, Content: ScrollableContentView
|
|||||||
}
|
}
|
||||||
|
|
||||||
let difference = self.scrollView.contentOffset.y - showNavigationBarThreshold
|
let difference = self.scrollView.contentOffset.y - showNavigationBarThreshold
|
||||||
let range = maximumContentY - (maximumContentY - padding - headerFrame.height) - inset
|
|
||||||
|
let range: Double
|
||||||
|
if self.presentingViewController == nil && self.parent?.presentingViewController == nil
|
||||||
|
{
|
||||||
|
// Not presented modally, so rely on safe area + navigation bar height.
|
||||||
|
range = (headerFrame.height + padding) - (self.navigationController?.navigationBar.bounds.height ?? self.view.safeAreaInsets.top)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Presented modally, so rely on maximumContentY.
|
||||||
|
range = maximumContentY - (maximumContentY - padding - headerFrame.height) - inset
|
||||||
|
}
|
||||||
|
|
||||||
let fractionComplete = min(difference, range) / range
|
let fractionComplete = min(difference, range) / range
|
||||||
self.navigationBarAnimator?.fractionComplete = fractionComplete
|
self.navigationBarAnimator?.fractionComplete = fractionComplete
|
||||||
|
|||||||
Reference in New Issue
Block a user