add tests for masking with gaps
This commit is contained in:
parent
134b7d246f
commit
dbf70e9b1d
3 changed files with 28 additions and 0 deletions
BIN
tests/paths/maskStrokeRectMask.png
Normal file
BIN
tests/paths/maskStrokeRectMask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 221 B |
BIN
tests/paths/rectMaskStroke.png
Normal file
BIN
tests/paths/rectMaskStroke.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 400 B |
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue