add dragon2 test

This commit is contained in:
Ryan Oldenburg 2021-12-03 15:24:06 -06:00
parent 8baa04a6cb
commit 5d0539bf9b
6 changed files with 1387 additions and 7 deletions

View file

@ -151,12 +151,6 @@ proc decodeCtxInternal(inherited: Ctx, node: XmlNode): Ctx =
if opacity.len > 0: if opacity.len > 0:
result.opacity = clamp(parseFloat(opacity), 0, 1) result.opacity = clamp(parseFloat(opacity), 0, 1)
if fillOpacity.len > 0:
result.fill.opacity = clamp(parseFloat(fillOpacity), 0, 1)
if strokeOpacity.len > 0:
result.strokeOpacity = clamp(parseFloat(strokeOpacity), 0, 1)
if fillRule == "": if fillRule == "":
discard # Inherit discard # Inherit
elif fillRule == "nonzero": elif fillRule == "nonzero":
@ -197,6 +191,12 @@ proc decodeCtxInternal(inherited: Ctx, node: XmlNode): Ctx =
result.stroke = parseHtmlColor(stroke).rgbx result.stroke = parseHtmlColor(stroke).rgbx
result.shouldStroke = true result.shouldStroke = true
if fillOpacity.len > 0:
result.fill.opacity = parseFloat(fillOpacity).clamp(0, 1)
if strokeOpacity.len > 0:
result.strokeOpacity = parseFloat(strokeOpacity).clamp(0, 1)
if strokeWidth == "": if strokeWidth == "":
discard # Inherit discard # Inherit
else: else:

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 705 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

View file

@ -13,7 +13,8 @@ const files = [
"Ghostscript_Tiger", "Ghostscript_Tiger",
"scale", "scale",
"miterlimit", "miterlimit",
"dashes" "dashes",
"dragon2"
] ]
proc doDiff(rendered: Image, name: string) = proc doDiff(rendered: Image, name: string) =