Se7eN
03/04/2021, 3:51 PMSnapshotStateList
of Path
. How do I redraw when I edit one of my Path
objects from the list? I'm implementing drawing with finger
Canvas(
modifier.pointerInput(Unit) {
detectDragGestures(
onDragStart = { position -> paths.add(Path().also { moveTo(...) }) },
onDragEnd = { ... },
onDragCancel = { ... },
onDrag = { change, dragAmount ->
change.consumePositionChange()
paths.last().quadraticBezierTo(...)
}
)
}
) {
paths.value.forEach { path ->
drawPath(path, ...)
}
}
paths[paths.lastIndex] = paths.last()
to make it work but it feels hacky