add tests for masking with gaps

This commit is contained in:
Ryan Oldenburg 2022-06-15 22:27:04 -05:00
parent 134b7d246f
commit dbf70e9b1d
3 changed files with 28 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

View file

@ -451,6 +451,24 @@ block:
)
image.writeFile("tests/paths/rectMaskAA.png")
block:
let image = newImage(100, 100)
image.fillPath(
"M 10 10 H 60 V 60 H 10 z",
rgbx(255, 0, 0, 255)
)
let paint = newPaint(SolidPaint)
paint.color = color(0, 1, 0, 1)
paint.blendMode = MaskBlend
image.strokePath(
"M 30 30 H 50 V 50 H 30 z",
paint,
strokeWidth = 10
)
image.writeFile("tests/paths/rectMaskStroke.png")
block:
let mask = newMask(100, 100)
mask.fillPath("M 10 10 H 60 V 60 H 10 z")
@ -478,6 +496,16 @@ block:
mask.fillPath("M 30.1 30.1 H 80.1 V 80.1 H 30.1 z", blendMode = MaskBlend)
writeFile("tests/paths/maskRectMaskAA.png", mask.encodePng())
block:
let mask = newMask(100, 100)
mask.fillPath("M 10 10 H 60 V 60 H 10 z")
mask.strokePath(
"M 30 30 H 50 V 50 H 30 z",
strokeWidth = 10,
blendMode = MaskBlend
)
writeFile("tests/paths/maskStrokeRectMask.png", mask.encodePng())
block:
var
surface = newImage(256, 256)