mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-01 08:45:48 +00:00
Various fixes
This commit is contained in:
@@ -257,7 +257,7 @@ public final class MediaStreamComponent: CombinedComponent {
|
||||
let local = Local()
|
||||
|
||||
return { context in
|
||||
_body(context, local) // { context in
|
||||
_body(context, local)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1052,10 +1052,10 @@ public final class MediaStreamComponentController: ViewControllerComponentContai
|
||||
view.expandFromPictureInPicture()
|
||||
}
|
||||
|
||||
self.view.clipsToBounds = true
|
||||
|
||||
self.view.layer.animatePosition(from: CGPoint(x: self.view.frame.center.x, y: self.view.bounds.maxY + self.view.bounds.height / 2), to: self.view.center, duration: 0.5, timingFunction: kCAMediaTimingFunctionSpring, completion: { _ in
|
||||
})
|
||||
self.view.clipsToBounds = true
|
||||
|
||||
self.view.layer.animatePosition(from: CGPoint(x: self.view.frame.center.x, y: self.view.bounds.maxY + self.view.bounds.height / 2), to: self.view.center, duration: 0.5, timingFunction: kCAMediaTimingFunctionSpring, completion: { _ in
|
||||
})
|
||||
|
||||
self.view.layer.allowsGroupOpacity = true
|
||||
|
||||
@@ -1081,8 +1081,7 @@ public final class MediaStreamComponentController: ViewControllerComponentContai
|
||||
|
||||
override public func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// TODO: replace with actual color
|
||||
backgroundDimView.backgroundColor = .black.withAlphaComponent(0.3)
|
||||
self.backgroundDimView.backgroundColor = .black.withAlphaComponent(0.3)
|
||||
self.view.clipsToBounds = false
|
||||
}
|
||||
|
||||
@@ -1094,7 +1093,7 @@ public final class MediaStreamComponentController: ViewControllerComponentContai
|
||||
override public func viewDidLayoutSubviews() {
|
||||
super.viewDidLayoutSubviews()
|
||||
let dimViewSide: CGFloat = max(view.bounds.width, view.bounds.height)
|
||||
backgroundDimView.frame = .init(x: view.bounds.midX - dimViewSide / 2, y: -view.bounds.height * 3, width: dimViewSide, height: view.bounds.height * 4)
|
||||
self.backgroundDimView.frame = .init(x: view.bounds.midX - dimViewSide / 2, y: -view.bounds.height * 3, width: dimViewSide, height: view.bounds.height * 4)
|
||||
}
|
||||
|
||||
public func dismiss(closing: Bool, manual: Bool) {
|
||||
|
||||
@@ -580,7 +580,9 @@ final class MediaStreamVideoComponent: Component {
|
||||
videoView.isHidden = true
|
||||
}
|
||||
} else {
|
||||
videoSize = CGSize(width: 16 / 9 * 100.0, height: 100.0).aspectFitted(.init(width: availableSize.width - videoInset * 2, height: availableSize.height))
|
||||
let availableVideoWidth = min(availableSize.width, availableSize.height) - videoInset * 2
|
||||
let availableVideoHeight = availableVideoWidth * 9.0 / 16
|
||||
videoSize = CGSize(width: 16 / 9 * 100.0, height: 100.0).aspectFitted(.init(width: availableVideoWidth, height: availableVideoHeight))
|
||||
}
|
||||
|
||||
let loadingBlurViewFrame = CGRect(origin: CGPoint(x: floor((availableSize.width - videoSize.width) / 2.0), y: floor((availableSize.height - videoSize.height) / 2.0)), size: videoSize)
|
||||
|
||||
@@ -431,7 +431,7 @@ public class MinimizedContainerImpl: ASDisplayNode, MinimizedContainer, ASScroll
|
||||
|
||||
if let _ = self.item(at: location.y) {
|
||||
if self.isExpanded {
|
||||
return abs(velocity.x) > abs(velocity.y)
|
||||
return abs(velocity.x) > abs(velocity.y) && !self.isApplyingTransition
|
||||
} else {
|
||||
return abs(velocity.y) > abs(velocity.x)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user