Nat Strangerweather
04/23/2021, 9:18 PMNat Strangerweather
04/23/2021, 9:18 PMfun drawDynamicGrid(
listOfWords: List<String>,
bitmapWidth: Float,
bitMapHeight: Float,
drawLine: // what to put here as Type?
) {
// Dynamic Grid
val spacingX = 150f
val spacingY = 70f
var anchorX = spacingX
var anchorY = spacingY
while (anchorX < getWordCount(listOfWords)) {
drawLine(
strokeWidth = 2F, color = Color.White, start = Offset(anchorX, 0f),
end = Offset(anchorX, bitMapHeight)
)
anchorX += spacingX
}
while (anchorY < 2) {
drawLine(
strokeWidth = 2F, color = Color.White, start = Offset(0f, anchorY),
end = Offset(bitmapWidth, anchorY)
)
anchorY += spacingY
}
}loloof64
04/23/2021, 9:22 PMfun DrawScope.drawline(...) {
}loloof64
04/23/2021, 9:23 PMdrawDynamicGrid you can call drawline .Nat Strangerweather
04/23/2021, 9:24 PMNat Strangerweather
04/24/2021, 7:47 AMloloof64
04/24/2021, 8:02 AMCanvas or a call to Modifier.drawBehind ? If so, we may find a workaround.loloof64
04/24/2021, 8:04 AMDrawScope.drawline( by just drawline , in both calls to drawline .Nat Strangerweather
04/24/2021, 8:04 AMCanvasDrawScope().draw(
Density(1.0f), LayoutDirection.Ltr, canvas,
Size(bitmapWidth, bitMapHeight),
) {loloof64
04/24/2021, 8:05 AMCanvasDrawScope ? If so, you can simply call drawLine each time (without the `DrawScope.`prefix)Nat Strangerweather
04/24/2021, 8:06 AMNat Strangerweather
04/24/2021, 8:06 AMCanvasDrawScopeloloof64
04/24/2021, 8:07 AMNat Strangerweather
04/24/2021, 8:08 AMNat Strangerweather
04/24/2021, 8:08 AMloloof64
04/24/2021, 8:08 AMNat Strangerweather
04/24/2021, 8:09 AM