Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ extension AnyAddingTransition {
) -> Self {

return .init { (context: AddingTransitionContext) in

let entrypointSnapshotView = AnyMirrorViewProvider.portal(view: entrypointView, hidesSourceOnUsing: true).view()

let maskView = UIView()
maskView.backgroundColor = .black

if context.contentView.backgroundColor == nil {
context.contentView.backgroundColor = .clear
}

//Fluid.doIfNotAnimating(view: context.toViewController.view) { _ in
do {
maskView.frame = context.toViewController.view.bounds
Expand Down Expand Up @@ -51,8 +51,18 @@ extension AnyAddingTransition {
/// make initial state for displaying view
let translation = Geometry.centerAndScale(from: context.contentView.bounds, to: fromFrame)

context.toViewController.view.transform = .init(scaleX: translation.scale.x, y: translation.scale.y)
context.toViewController.view.center = translation.center
// Use transform translation instead of view.center to avoid breaking UIKeyboardLayoutGuide
let currentCenter = context.toViewController.view.center
let offset = CGPoint(
x: translation.center.x - currentCenter.x,
y: translation.center.y - currentCenter.y
)

// Combine scale and translation
// Note: translate amount is scaled, so we need to divide by scale
context.toViewController.view.transform = CGAffineTransform(scaleX: translation.scale.x, y: translation.scale.y)
.translatedBy(x: offset.x / translation.scale.x, y: offset.y / translation.scale.y)

context.toViewController.view.alpha = 0.2

// fix visually height against transforming
Expand Down
Loading