Julius Marozas
07/14/2020, 10:11 AMCanvas
. I see that the DrawScope.drawPath
function accepts Path
as a parameter. However, I also found a quite convenient path builder function PathData
which returns List<PathNode>
. Can I somehow pass that list of path nodes to DrawScope.drawPath
, i.e., construct a Path
from List<PathNode>
?val path = Path().apply {
moveTo(1f, 2f)
lineTo(3f, 4f)
lineTo(5f, 7f)
}
drawPath(path, Color.Red)
Now the issue is that the path has a fill (either with non-zero or even-odd PathFillType
). How can I make a path without any fill?drawCanvas { canvas, size ->
canvas.drawPath(path, Paint().apply {
color = Color.Red
style = PaintingStyle.stroke
strokeWidth = 3
})
}
Note: drawCanvas
is a function in the DrawScope
, so it should be inside Canvas
composable.Andrey Kulikov
07/14/2020, 3:43 PM