Skip to content

Commit 2559ec6

Browse files
committed
Resolved the bug when parallaxFormula was calculated based on maxWidth for the vertical swipe directions
1 parent 4cdd9b2 commit 2559ec6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fragula-compose/src/main/kotlin/com/fragula2/compose/FragulaNavHost.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ private fun SwipeableBox(
220220
when (swipeDirection) {
221221
SwipeDirection.LEFT_TO_RIGHT -> -maxWidth.value * (1.0f - offsetProvider()) / parallaxFactor
222222
SwipeDirection.RIGHT_TO_LEFT -> maxWidth.value * (1.0f - offsetProvider()) / parallaxFactor
223-
SwipeDirection.TOP_TO_BOTTOM -> -maxWidth.value * (1.0f - offsetProvider()) / parallaxFactor
224-
SwipeDirection.BOTTOM_TO_TOP -> maxWidth.value * (1.0f - offsetProvider()) / parallaxFactor
223+
SwipeDirection.TOP_TO_BOTTOM -> -maxHeight.value * (1.0f - offsetProvider()) / parallaxFactor
224+
SwipeDirection.BOTTOM_TO_TOP -> maxHeight.value * (1.0f - offsetProvider()) / parallaxFactor
225225
}
226226
}
227227

0 commit comments

Comments
 (0)