Mark
03/21/2026, 10:22 AMIvan Matkov
03/23/2026, 8:08 AM1.11.0-alpha03 to 1.11.0-alpha04This version includes skia update from m138 to m144 (6 months diff from upstream), so it looks like it's most likely something there
Ivan Matkov
03/23/2026, 8:15 AMMark
03/23/2026, 9:13 AMimport androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Path
import androidx.compose.ui.graphics.PathMeasure
import androidx.compose.ui.graphics.drawscope.Stroke
/**
* ULTRA-MINIMAL reproduction for a stroke animation glitch on iOS (CMP 1.11.0-alpha04).
*
* If the bug is present, you will see a red line swinging from the top-left origin (0,0)
* to the stroke, like a clock hand.
*
* On fixed versions (or 1.11.0-alpha03), there should be only a clean, floating segment.
*/
@Composable
fun StrokeBugReproduction(modifier: Modifier = Modifier) {
// A path that is far from (0,0)
val path = remember {
Path().apply {
moveTo(300f, 300f)
lineTo(800f, 800f)
}
}
val pathMeasure = remember(path) {
PathMeasure().apply { setPath(path, false) }
}
// Re-using a persistent path object
val segmentPath = remember { Path() }
val transition = rememberInfiniteTransition()
val progress by transition.animateFloat(
initialValue = 0f,
targetValue = 1f,
animationSpec = infiniteRepeatable(
animation = tween(2000, easing = LinearEasing),
repeatMode = RepeatMode.Restart
)
)
Canvas(modifier = modifier.fillMaxSize()) {
segmentPath.reset()
val length = pathMeasure.length
// Start from 50% marker to force a non-zero start point
val startDistance = length * 0.5f
val stopDistance = length * progress
if (stopDistance > startDistance) {
// BUG: startWithMoveTo = true is ignored on iOS, defaulting to (0,0)
pathMeasure.getSegment(startDistance, stopDistance, segmentPath, true)
drawPath(
path = segmentPath,
color = Color.Red,
style = Stroke(width = 10f)
)
}
}
}Mark
03/23/2026, 9:36 AMIvan Matkov
03/23/2026, 9:37 AMMark
03/23/2026, 10:17 AMIvan Matkov
03/23/2026, 12:06 PM