From cdcbc932c13394067a060fb6b1703111b7446ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=9C=E5=9D=A1=E8=82=98=E5=AD=90?= <55673881+fatbobman@users.noreply.github.com> Date: Thu, 6 Aug 2020 16:35:48 +0800 Subject: [PATCH] fix button text wrong position --- Sources/SwipeCell/SwipeCellViewModifier1.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Sources/SwipeCell/SwipeCellViewModifier1.swift b/Sources/SwipeCell/SwipeCellViewModifier1.swift index 5e70d1f..34ba293 100644 --- a/Sources/SwipeCell/SwipeCellViewModifier1.swift +++ b/Sources/SwipeCell/SwipeCellViewModifier1.swift @@ -22,7 +22,7 @@ struct SwipeCellModifier:ViewModifier{ @State var leftOffset:CGFloat = -10000 @State var rightOffset:CGFloat = 10000 @State var spaceWidth:CGFloat = 0 - @State var spaceWidth1:CGFloat = 0 + let cellID = UUID() @@ -119,7 +119,6 @@ struct SwipeCellModifier:ViewModifier{ Color.clear HStack(spacing:0){ if position == .left { -// Rectangle().fill(Color.clear).frame(width:spaceWidth1) Spacer() } if slot.slotStyle == .destructive && slot.slots.count == 1 && position == .right { @@ -139,7 +138,6 @@ struct SwipeCellModifier:ViewModifier{ Rectangle().fill(Color.clear).frame(width:spaceWidth) } if position == .right{ -// Rectangle().fill(Color.clear).frame(width:spaceWidth1) Spacer() } } @@ -226,13 +224,11 @@ struct SwipeCellModifier:ViewModifier{ if feedStatus == .feedOnce { withAnimation(.linear) { spaceWidth = 0 - spaceWidth1 = frameWidth - slot.buttonWidth } } else { withAnimation(.linear) { spaceWidth = max(0,abs(offset) - slot.buttonWidth) - spaceWidth1 = frameWidth - slot.buttonWidth - spaceWidth } } }