Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
matteofontana-app committed Jun 14, 2023
1 parent 515e0b5 commit 85288ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Binary file not shown.
9 changes: 5 additions & 4 deletions Sources/OneFingerRotation/Version 1.0/ValueAutoRotation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ public struct ValueAutoRotation: ViewModifier {
.rotationEffect(rotationAngle, anchor: .center)
.onChange(of: totalAngle) { newValue in
if !isDragged {
if let animation = animation {
let difference = abs(newValue - rotationAngle.degrees)
if difference < 180, let animation = animation {
withAnimation(animation) {
rotationAngle = Angle(degrees: newValue)
//fullRotations = 0
fullRotations = 0
}
} else {
rotationAngle = Angle(degrees: newValue)
//fullRotations = 0
fullRotations = 0
}
}
}
Expand Down Expand Up @@ -105,7 +106,7 @@ public struct ValueAutoRotation: ViewModifier {
if autoRotationEnabled {
startAutoRotation()
}
//previousAngle = 0
previousAngle = 0
isDragged = false
}
)
Expand Down

0 comments on commit 85288ca

Please sign in to comment.