forked from shadowfacts/Tusker
Fix gallery content being incorrectly positioned on macOS when reduce motion is on
See #446
This commit is contained in:
parent
46b455c3d1
commit
69ee3bb4f0
|
@ -52,6 +52,9 @@ class GalleryDismissAnimationController: NSObject, UIViewControllerAnimatedTrans
|
|||
appliedSourceToDestTransform = false
|
||||
}
|
||||
|
||||
to.view.frame = container.bounds
|
||||
from.view.frame = container.bounds
|
||||
|
||||
let content = itemViewController.takeContent()
|
||||
content.view.translatesAutoresizingMaskIntoConstraints = true
|
||||
content.view.layer.masksToBounds = true
|
||||
|
@ -112,6 +115,8 @@ class GalleryDismissAnimationController: NSObject, UIViewControllerAnimatedTrans
|
|||
return
|
||||
}
|
||||
|
||||
toVC.view.frame = transitionContext.containerView.bounds
|
||||
fromVC.view.frame = transitionContext.containerView.bounds
|
||||
transitionContext.containerView.addSubview(toVC.view)
|
||||
transitionContext.containerView.addSubview(fromVC.view)
|
||||
|
||||
|
|
|
@ -121,8 +121,9 @@ class GalleryPresentationAnimationController: NSObject, UIViewControllerAnimated
|
|||
return
|
||||
}
|
||||
|
||||
transitionContext.containerView.addSubview(to.view)
|
||||
to.view.alpha = 0
|
||||
to.view.frame = transitionContext.containerView.bounds
|
||||
transitionContext.containerView.addSubview(to.view)
|
||||
|
||||
let duration = transitionDuration(using: transitionContext)
|
||||
let animator = UIViewPropertyAnimator(duration: duration, curve: .easeInOut)
|
||||
|
|
Loading…
Reference in New Issue