Browse Source

canvasNoSkikoTest: Setting attributes in builder rather than in DomSideEffect

with_mpp_example
Shagen Ogandzhanian 3 years ago
parent
commit
13eeb9aa6d
  1. 10
      web/core/src/jsTest/kotlin/skiko/CanvasSkikoTests.kt

10
web/core/src/jsTest/kotlin/skiko/CanvasSkikoTests.kt

@ -25,14 +25,12 @@ class CanvasSkikoTests {
@Test
fun canvasNoSkikoTest() = runTest {
composition {
Canvas {
// attr("height", "60")
// attr("width", "60")
Canvas({
attr("height", "60")
attr("width", "60")
}) {
DomSideEffect { canvas ->
canvas.width = 60
canvas.height = 60
val ctx = canvas.getContext("2d") as CanvasRenderingContext2D
ctx.beginPath()
ctx.rect(10.0, 10.0, 30.0, 30.0)

Loading…
Cancel
Save