Commit eeee26a3 by Daniel Dahan

development: added point MotionAnimation enum value

parent ef6923c7
......@@ -80,6 +80,7 @@ public enum MotionAnimation {
case translateZ(CGFloat)
case x(CGFloat)
case y(CGFloat)
case point(x: CGFloat, y: CGFloat)
case position(x: CGFloat, y: CGFloat)
case shadow(path: CGPath)
case fade(CGFloat)
......@@ -242,6 +243,8 @@ extension CALayer {
a.append(Motion.position(to: CGPoint(x: x + w / 2, y: s.position.y)))
case let .y(y):
a.append(Motion.position(to: CGPoint(x: s.position.x, y: y + h / 2)))
case let .point(x, y):
a.append(Motion.position(to: CGPoint(x: x + w / 2, y: y + h / 2)))
case let .position(x, y):
a.append(Motion.position(to: CGPoint(x: x, y: y)))
case let .shadow(path):
......
......@@ -495,6 +495,9 @@ open class MotionTransitionPresentedAnimator: MotionTransitionDelegate, UIViewCo
px = x + w / 2
case let .y(y):
py = y + h / 2
case let .point(x, y):
px = x + w / 2
py = y + h / 2
default:break
}
}
......@@ -513,10 +516,8 @@ open class MotionTransitionPresentedAnimator: MotionTransitionDelegate, UIViewCo
a.append(Motion.background(color: color))
case let .corners(radius):
a.append(Motion.corner(radius: radius))
case let .x(x):
a.append(Motion.position(to: CGPoint(x: x + w / 2, y: py)))
case let .y(y):
a.append(Motion.position(to: CGPoint(x: px, y: y + h / 2)))
case let .x(_), .y(_), .point(_, _):
a.append(Motion.position(to: CGPoint(x: px, y: py)))
case let .position(x, y):
a.append(Motion.position(to: CGPoint(x: x, y: y)))
case let .shadow(path):
......@@ -614,12 +615,8 @@ open class MotionTransitionDismissedAnimator: MotionTransitionDelegate, UIViewCo
a.append(Motion.background(color: .clear))
case let .corners(radius):
a.append(Motion.corner(radius: v2.cornerRadius))
case let .x(x):
a.append(Motion.position(to: v2.position))
case let .y(y):
a.append(Motion.position(to: v2.position))
case let .position(x, y):
a.append(Motion.position(to: v2.position))
case let .x(_), .y(_), .point(_, _), .position(_, _):
a.append(Motion.position(to: nil == v2.superview ? v2.position : v2.superview!.convert(v2.position, to: nil)))
case let .shadow(path):
a.append(Motion.shadow(path: path))
case let .width(w):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment