Skip to content

Commit

Permalink
fix button text wrong position
Browse files Browse the repository at this point in the history
  • Loading branch information
fatbobman committed Aug 6, 2020
1 parent cb1dfdb commit cdcbc93
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Sources/SwipeCell/SwipeCellViewModifier1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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 {
Expand All @@ -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()
}
}
Expand Down Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit cdcbc93

Please sign in to comment.