Emoji improvements

This commit is contained in:
Ali
2022-07-24 17:31:47 +02:00
parent 99207385b1
commit ea6929fef6
13 changed files with 191 additions and 42 deletions

View File

@@ -154,7 +154,7 @@ public extension ContainedViewLayoutTransition {
}
case let .animated(duration, curve):
let previousFrame: CGRect
if beginWithCurrentState, let presentation = node.layer.presentation() {
if beginWithCurrentState, (node.layer.animation(forKey: "position") != nil || node.layer.animation(forKey: "bounds") != nil), let presentation = node.layer.presentation() {
previousFrame = presentation.frame
} else {
previousFrame = node.frame
@@ -290,7 +290,7 @@ public extension ContainedViewLayoutTransition {
}
case let .animated(duration, curve):
let previousBounds: CGRect
if beginWithCurrentState, let presentation = node.layer.presentation() {
if beginWithCurrentState, node.layer.animation(forKey: "bounds") != nil, let presentation = node.layer.presentation() {
previousBounds = presentation.bounds
} else {
previousBounds = node.bounds
@@ -341,8 +341,8 @@ public extension ContainedViewLayoutTransition {
}
case let .animated(duration, curve):
let previousPosition: CGPoint
if beginWithCurrentState {
previousPosition = node.layer.presentation()?.position ?? node.position
if beginWithCurrentState, node.layer.animation(forKey: "position") != nil, let presentation = node.layer.presentation() {
previousPosition = presentation.position
} else {
previousPosition = node.position
}