scale as test
This commit is contained in:
parent
41eeb8ce7a
commit
7d3d5acfb5
|
@ -1,12 +0,0 @@
|
|||
import pixie
|
||||
|
||||
let image = newImage(100, 100)
|
||||
image.fill(rgba(255, 255, 255, 255))
|
||||
|
||||
let flower = readImage("examples/data/scale.svg")
|
||||
|
||||
image.draw(
|
||||
flower
|
||||
)
|
||||
|
||||
image.writeFile("examples/scale.png")
|
|
@ -373,7 +373,8 @@ proc decodeSvg*(data: string, width = 0, height = 0): Image =
|
|||
|
||||
if viewBoxMinX != 0 or viewBoxMinY != 0:
|
||||
rootCtx.transform = rootCtx.transform * translate(
|
||||
vec2(-viewBoxMinX.float32, -viewBoxMinY.float32))
|
||||
vec2(-viewBoxMinX.float32, -viewBoxMinY.float32)
|
||||
)
|
||||
|
||||
if width == 0 and height == 0: # Default to the view box size
|
||||
result = newImage(viewBoxWidth, viewBoxHeight)
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 280 KiB |
BIN
tests/images/svg/scale.png
Normal file
BIN
tests/images/svg/scale.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 459 B After Width: | Height: | Size: 459 B |
|
@ -10,7 +10,8 @@ const files = [
|
|||
"ellipse01",
|
||||
"triangle01",
|
||||
"quad01",
|
||||
"Ghostscript_Tiger"
|
||||
"Ghostscript_Tiger",
|
||||
"scale"
|
||||
]
|
||||
|
||||
for file in files:
|
||||
|
@ -21,4 +22,4 @@ for file in files:
|
|||
|
||||
let (score, _) = diff(image, gold)
|
||||
doAssert score < 1
|
||||
# image.writeFile(&"tests/images/svg/{file}.png")
|
||||
image.writeFile(&"tests/images/svg/{file}.png")
|
||||
|
|
Loading…
Reference in a new issue