Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-11-20 02:41:25 +04:00
parent 5d9a17ed83
commit ef4b0831c3
2 changed files with 13 additions and 7 deletions

View File

@@ -1325,7 +1325,7 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
var originalContentFrame = CGRect(origin: CGPoint(x: originalContentX, y: originalContentY), size: originalProjectedContentViewFrame.1.size)
let topEdge = max(contentTopInset, self.contentAreaInScreenSpace?.minY ?? 0.0)
let bottomEdge = max(layout.intrinsicInsets.bottom, self.contentAreaInScreenSpace?.maxY ?? layout.size.height)
let bottomEdge = min(layout.size.height - layout.intrinsicInsets.bottom, self.contentAreaInScreenSpace?.maxY ?? layout.size.height)
if originalContentFrame.minY < topEdge {
let requiredOffset = topEdge - originalContentFrame.minY
@@ -1333,8 +1333,8 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
let offset = min(requiredOffset, availableOffset)
originalActionsFrame = originalActionsFrame.offsetBy(dx: 0.0, dy: offset)
originalContentFrame = originalContentFrame.offsetBy(dx: 0.0, dy: offset)
} else if originalContentFrame.maxY > bottomEdge {
let requiredOffset = bottomEdge - originalContentFrame.maxY
} else if originalActionsFrame.maxY > bottomEdge {
let requiredOffset = bottomEdge - originalActionsFrame.maxY
let offset = requiredOffset
originalActionsFrame = originalActionsFrame.offsetBy(dx: 0.0, dy: offset)
originalContentFrame = originalContentFrame.offsetBy(dx: 0.0, dy: offset)