Animation updates

This commit is contained in:
Ali
2021-08-10 21:18:55 +02:00
parent e170f2fe5a
commit 904b048a34
46 changed files with 961 additions and 596 deletions

View File

@@ -175,6 +175,8 @@ public final class _UpdatedChildComponent {
var _removed: Bool = false
var _position: CGPoint?
var _opacity: CGFloat?
var _cornerRadius: CGFloat?
var _clipsToBounds: Bool?
fileprivate var transitionAppear: Transition.Appear?
fileprivate var transitionAppearWithGuide: (Transition.AppearWithGuide, _AnyChildComponent.Id)?
@@ -241,6 +243,16 @@ public final class _UpdatedChildComponent {
return self
}
@discardableResult public func cornerRadius(_ cornerRadius: CGFloat) -> _UpdatedChildComponent {
self._cornerRadius = cornerRadius
return self
}
@discardableResult public func clipsToBounds(_ clipsToBounds: Bool) -> _UpdatedChildComponent {
self._clipsToBounds = clipsToBounds
return self
}
@discardableResult public func gesture(_ gesture: Gesture) -> _UpdatedChildComponent {
self.gestures.append(gesture)
return self
@@ -672,6 +684,8 @@ public extension CombinedComponent {
updatedChild.view.frame = updatedChild.size.centered(around: updatedChild._position ?? CGPoint())
updatedChild.view.alpha = updatedChild._opacity ?? 1.0
updatedChild.view.clipsToBounds = updatedChild._clipsToBounds ?? false
updatedChild.view.layer.cornerRadius = updatedChild._cornerRadius ?? 0.0
updatedChild.view.context(typeErasedComponent: updatedChild.component).erasedState._updated = { [weak viewContext] transition in
guard let viewContext = viewContext else {
return