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.
1 parent dfba104 commit ed409afCopy full SHA for ed409af
library/src/commonMain/kotlin/ir/mahozad/multiplatform/wavyslider/Core.kt
@@ -107,6 +107,7 @@ data class WaveAnimationSpecs(
107
*/
108
typealias WaveVelocity = Pair<Dp, WaveDirection>
109
110
+private val wavyPath = Path()
111
internal val defaultIncremental = false
112
internal val defaultWaveLength = 20.dp
113
internal val defaultWaveHeight = 6.dp
@@ -177,7 +178,8 @@ internal inline fun DrawScope.createWavyPath(
177
178
waveSpread: Float,
179
waveShift: Dp,
180
incremental: Boolean
-): Path = Path().apply {
181
+): Path = wavyPath.apply {
182
+ rewind()
183
val waveShiftPx = waveShift.toPx()
184
val waveLengthPx = waveLength.toPx()
185
val waveHeightPx = waveHeight.toPx().absoluteValue
0 commit comments