We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 66305bd + 3b4108b commit 9f35284Copy full SHA for 9f35284
wheel-picker-compose/src/main/java/com/commandiron/wheel_picker_compose/core/WheelPicker.kt
@@ -143,8 +143,13 @@ private fun calculateAnimatedRotationX(
143
val layoutInfo = remember { derivedStateOf { lazyListState.layoutInfo } }.value
144
val viewPortHeight = layoutInfo.viewportSize.height.toFloat()
145
val singleViewPortHeight = viewPortHeight / rowCount
146
+ val animatedRotationX = -20f * (distanceToIndexSnap / singleViewPortHeight)
147
- return -20f * (distanceToIndexSnap / singleViewPortHeight)
148
+ return if (animatedRotationX.isNaN()) {
149
+ 0f
150
+ } else {
151
+ animatedRotationX
152
+ }
153
}
154
155
object WheelPickerDefaults{
0 commit comments