Various fixes

This commit is contained in:
Ilya Laktyushin
2024-06-28 17:45:00 +04:00
parent ed8f1b35e9
commit 9d3cc5996b
12 changed files with 66 additions and 17 deletions

View File

@@ -392,7 +392,10 @@ public class AttachmentController: ViewController {
self.container.interactivelyDismissed = { [weak self] velocity in
if let strongSelf = self, let layout = strongSelf.validLayout {
if let controller = strongSelf.controller, controller.shouldMinimizeOnSwipe?(strongSelf.currentType) == true {
let delta = layout.size.height - controller.minimizedTopEdgeOffset
var delta = layout.size.height
if let minimizedTopEdgeOffset = controller.minimizedTopEdgeOffset {
delta -= minimizedTopEdgeOffset
}
let damping: CGFloat = 180.0
let initialVelocity: CGFloat = delta > 0.0 ? velocity / delta : 0.0