From d1647c26c394b61525e6fdde1cc809b116f582b8 Mon Sep 17 00:00:00 2001 From: tsuzukihashi Date: Sat, 29 Apr 2023 01:26:47 +0900 Subject: [PATCH] fix: animation --- Sources/TsuzuKit/CapsuleButtonStyle.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/TsuzuKit/CapsuleButtonStyle.swift b/Sources/TsuzuKit/CapsuleButtonStyle.swift index f5bc59c..6c8aa4d 100644 --- a/Sources/TsuzuKit/CapsuleButtonStyle.swift +++ b/Sources/TsuzuKit/CapsuleButtonStyle.swift @@ -19,7 +19,9 @@ public struct CapsuleButtonStyle: ButtonStyle { .background( Capsule() .fill(backgroundColor) + .scaleEffect(configuration.isPressed ? 1.05 : 1) ) + .animation(.spring(response: 0.2, dampingFraction: 0.9), value: configuration.isPressed) } }