From dc46eeb2559a90383500187af1b4420581afd3ed Mon Sep 17 00:00:00 2001 From: Byeonjinha Date: Tue, 2 Jan 2024 22:29:36 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8[feat]:=20=20=EC=B9=B4=EB=A1=9C?= =?UTF-8?q?=EC=85=80=20swipe=20=EA=B0=80=EC=A4=91=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Sources/View/SnapCarousel/SnapCarousel.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PingPong/Projects/DesignSystem/Sources/View/SnapCarousel/SnapCarousel.swift b/PingPong/Projects/DesignSystem/Sources/View/SnapCarousel/SnapCarousel.swift index ccf05c8a..ddc23b43 100644 --- a/PingPong/Projects/DesignSystem/Sources/View/SnapCarousel/SnapCarousel.swift +++ b/PingPong/Projects/DesignSystem/Sources/View/SnapCarousel/SnapCarousel.swift @@ -53,7 +53,9 @@ public struct SnapCarousel : View{ }) .onEnded({value in let offsetX = value.translation.width - let progress = -offsetX / width + + //MARK: - 가중치 + let progress = (-offsetX / width) * 1.2 let roundIndex = progress.rounded() currentIndex = max(min(currentIndex + Int(roundIndex),list.count - 1 ), 0 ) currentIndex = index