swiping seems to work fine, need to fix dragoffset now
parent
56b32c39ab
commit
a8648b8508
|
@ -410,36 +410,29 @@ struct ContentView: View {
|
|||
if startSwipeDir == .left {
|
||||
maxOffsetLeft = .zero
|
||||
maxOffsetRight = .zero
|
||||
} else {
|
||||
} else if startSwipeDir == .right {
|
||||
maxOffsetLeft = CGFloat(200)
|
||||
maxOffsetRight = .zero
|
||||
maxOffsetRight = CGFloat(10)
|
||||
}
|
||||
}
|
||||
|
||||
if newOffset + pulledOut.width < -maxOffsetLeft {
|
||||
if startSwipeState == .right && startSwipeDir == .left {
|
||||
print("meow here")
|
||||
newOffset = -maxOffsetLeft + rubberBandEffect(newOffset + maxOffsetLeft) - pulledOut.width
|
||||
} else {
|
||||
|
||||
print("meow here")
|
||||
newOffset = -maxOffsetLeft + rubberBandEffect(newOffset + maxOffsetLeft)
|
||||
}
|
||||
|
||||
} else if newOffset + pulledOut.width > maxOffsetRight {
|
||||
if startSwipeState == .left, startSwipeDir == .right {
|
||||
newOffset = maxOffsetRight + rubberBandEffect(newOffset - maxOffsetRight) - pulledOut.width
|
||||
} else {
|
||||
newOffset = maxOffsetRight + rubberBandEffect(newOffset - maxOffsetRight)
|
||||
}
|
||||
|
||||
// if newOffset.height < -maxOffset {
|
||||
// newOffset.height = -maxOffset + rubberBandEffect(newOffset.height + maxOffset)
|
||||
// } else if newOffset.height > maxOffset {
|
||||
// newOffset.height = maxOffset + rubberBandEffect(newOffset.height - maxOffset)
|
||||
// }
|
||||
}
|
||||
|
||||
self.mainSwipe.width = newOffset
|
||||
|
||||
|
||||
|
||||
// dragOffset is what is used to make the text be readable
|
||||
// with the right pane being visible
|
||||
|
||||
|
|
Loading…
Reference in New Issue