Fix video rotation

This commit is contained in:
Ali 2021-01-26 19:49:00 +05:00
parent ff7446ba69
commit 0fbb849637

View File

@ -103,7 +103,7 @@ public final class MediaPlayerNode: ASDisplayNode {
self.currentRotationAngle = rotationAngle
self.currentAspect = aspect
var transform = CGAffineTransform(rotationAngle: CGFloat(rotationAngle))
if !rotationAngle.isZero {
if abs(rotationAngle).remainder(dividingBy: Double.pi / 2.0) > 0.1 {
transform = transform.scaledBy(x: CGFloat(aspect), y: CGFloat(1.0 / aspect))
}
videoLayer.setAffineTransform(transform)