fix opaqueBounds test

This commit is contained in:
treeform 2022-08-02 10:06:36 -07:00
parent 19ec00c81b
commit 791eec8eda
2 changed files with 4 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 372 B

View file

@ -244,20 +244,17 @@ block:
doAssert image.opaqueBounds() == rect(0.0, 0.0, 100.0, 100.0) doAssert image.opaqueBounds() == rect(0.0, 0.0, 100.0, 100.0)
block: block:
let image = newImage(100, 100) let image = newImage(160, 160)
image.fillPath( image.fillPath(
""" """
M 20 60 M 20 20
A 40 40 90 0 1 100 60 L 140 20
A 40 40 90 0 1 180 60 L 80 140
Q 180 120 100 180
Q 20 120 20 60
z z
""", """,
parseHtmlColor("#FC427B").rgba, parseHtmlColor("#FC427B").rgba,
scale(vec2(0.3, 0.3)) scale(vec2(0.3, 0.3))
) )
let rect = image.opaqueBounds() let rect = image.opaqueBounds()
doAssert rect == rect(6.0, 6.0, 48.0, 48.0)
let trimmedImage = image.subImage(rect) let trimmedImage = image.subImage(rect)
trimmedImage.xray("tests/images/opaqueBounds.png") trimmedImage.xray("tests/images/opaqueBounds.png")