Fix issue with Gradient rendering.
This commit is contained in:
parent
1f0b711355
commit
cd2b78459a
1 changed files with 6 additions and 2 deletions
|
|
@ -145,13 +145,17 @@ private fun Modifier.focusedEvent(
|
||||||
ElementTheme.materialColors.background
|
ElementTheme.materialColors.background
|
||||||
)
|
)
|
||||||
val verticalOffset = focusedEventOffset.toPx()
|
val verticalOffset = focusedEventOffset.toPx()
|
||||||
|
val verticalRatio = 0.7f
|
||||||
return drawWithCache {
|
return drawWithCache {
|
||||||
val brush = Brush.verticalGradient(gradientColors)
|
val brush = Brush.verticalGradient(
|
||||||
|
colors = gradientColors,
|
||||||
|
endY = size.height * verticalRatio,
|
||||||
|
)
|
||||||
onDrawBehind {
|
onDrawBehind {
|
||||||
drawRect(
|
drawRect(
|
||||||
brush,
|
brush,
|
||||||
topLeft = Offset(0f, verticalOffset),
|
topLeft = Offset(0f, verticalOffset),
|
||||||
size = Size(size.width, size.height * 0.7f)
|
size = Size(size.width, size.height * verticalRatio)
|
||||||
)
|
)
|
||||||
drawLine(
|
drawLine(
|
||||||
highlightedLineColor,
|
highlightedLineColor,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue