Skip to content

Commit 525179f

Browse files
committed
Resolved the bug when vertical the elevation brush in the vertical orientations got the wrong orientation gradient
1 parent 28acfe9 commit 525179f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,14 @@ private fun PageElevation(
399399
}
400400
},
401401
) {
402+
val colors = listOf(ElevationEnd, ElevationStart)
403+
val brush = if(swipeDirection.isHorizontal()) Brush.horizontalGradient(
404+
colors = colors,
405+
) else Brush.verticalGradient(
406+
colors = colors,
407+
)
402408
drawRect(
403-
brush = Brush.horizontalGradient(
404-
colors = listOf(ElevationEnd, ElevationStart),
405-
),
409+
brush = brush,
406410
)
407411
}
408412
}

0 commit comments

Comments
 (0)