multiple layers test

This commit is contained in:
Ryan Oldenburg 2021-05-23 20:52:06 -05:00
parent b73b88bb63
commit 67c55b0422
2 changed files with 25 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -408,6 +408,31 @@ block:
ctx.image.writeFile("tests/images/context/clip_1e.png")
block:
let ctx = newContext(newImage(300, 150))
ctx.save()
ctx.beginPath()
ctx.circle(100, 75, 50)
ctx.clip()
ctx.saveLayer()
ctx.fillStyle = "red"
ctx.fillRect(0, 0, ctx.image.width.float32, ctx.image.height.float32)
ctx.restore()
ctx.saveLayer()
ctx.fillStyle = "orange"
ctx.fillRect(0, 0, 100, 100)
ctx.restore() # Pop the layer
ctx.image.writeFile("tests/images/context/clip_1f.png")
block:
let ctx = newContext(newImage(300, 150))