 
 private extension AnimatablePresentationController {
 
-  func modalSize() -> CGSize {
+  var modalSize: CGSize {
     let containerSize = containerFrame.size
     let width = CGFloat(presentationConfiguration.modalSize.0.width(parentSize: containerSize))
     let height = CGFloat(presentationConfiguration.modalSize.1.height(parentSize: containerSize))
     return CGSize(width: width, height: height)
   }
 
-  func modalCenter() -> CGPoint? {
-    return presentationConfiguration.modalPosition.calculateCenter(containerBounds: containerFrame, modalSize: modalSize())
-  }
-
-  func modalOrigin() -> CGPoint? {
+  var modalCenter: CGPoint? {
+    return presentationConfiguration.modalPosition.modalCenter(in: containerFrame, modalSize: modalSize)
+  }
+
+  var modalOrigin: CGPoint? {
     return presentationConfiguration.modalPosition.calculateOrigin()
   }
 

    var presentedViewFrame = CGRect.zero
    let sizeForChildContentContainer = size(forChildContentContainer: presentedViewController, withParentContainerSize: containerBounds.size)
    let origin: CGPoint
    if let center = modalCenter() {
      origin = calculateOrigin(center: center, size: sizeForChildContentContainer)
    } else {
      origin = modalOrigin() ?? .zero
    }

    presentedViewFrame.size = sizeForChildContentContainer

  }

  override func size(forChildContentContainer container: UIContentContainer, withParentContainerSize parentSize: CGSize) -> CGSize {
    return modalSize
  }

  override func containerViewWillLayoutSubviews() {
