This commit is contained in:
Ryan Oldenburg 2022-05-21 19:23:46 -05:00
parent ce4ac78b5d
commit 88576efdd3

View file

@ -297,7 +297,6 @@ proc parseSvgProperties(node: XmlNode, inherited: SvgProperties): SvgProperties
failInvalidTransform(transform)
proc fill(img: Image, path: Path, props: SvgProperties) =
if props.display and props.opacity > 0:
if props.fill == "none":
return
@ -322,7 +321,6 @@ proc fill(img: Image, path: Path, props: SvgProperties) =
img.fillPath(path, paint, props.transform, props.fillRule)
proc stroke(img: Image, path: Path, props: SvgProperties) =
if props.display and props.opacity > 0:
let paint = newPaint(props.stroke)
paint.color.a *= (props.opacity * props.strokeOpacity)
img.strokePath(
@ -576,6 +574,7 @@ proc decodeSvg*(
for node in root.items:
renderInfos.add node.parseSvgElement(propertiesStack)
for (path, props) in renderInfos:
if props.display and props.opacity > 0:
result.fill(path, props)
if props.stroke != rgbx(0, 0, 0, 0) and props.strokeWidth > 0:
result.stroke(path, props)