multiple layers test
This commit is contained in:
parent
b73b88bb63
commit
67c55b0422
2 changed files with 25 additions and 0 deletions
BIN
tests/images/context/clip_1f.png
Normal file
BIN
tests/images/context/clip_1f.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in a new issue