bring back

This commit is contained in:
Ryan Oldenburg 2021-11-26 21:01:57 -06:00
parent 4d416f1053
commit be525814b0
2 changed files with 18 additions and 2 deletions

View file

@ -245,8 +245,7 @@ proc decodeCtxInternal(inherited: Ctx, node: XmlNode): Ctx =
if strokeOpacity.len == 0: if strokeOpacity.len == 0:
strokeOpacity = parts[1].strip() strokeOpacity = parts[1].strip()
else: else:
when defined(pixieDebugSvg): discard
maybeLogPair(parts[0], parts[1])
elif pair.len > 0: elif pair.len > 0:
when defined(pixieDebugSvg): when defined(pixieDebugSvg):
echo "Invalid style pair: ", pair echo "Invalid style pair: ", pair

View file

@ -79,6 +79,23 @@ proc decodeCtxInternal(inherited: Ctx, node: XmlNode): Ctx =
fillOpacity = node.attr("fill-opacity") fillOpacity = node.attr("fill-opacity")
strokeOpacity = node.attr("stroke-opacity") strokeOpacity = node.attr("stroke-opacity")
when defined(pixieDebugSvg):
proc maybeLogPair(k, v: string) =
if k notin [
"fill-rule", "fill", "stroke", "stroke-width", "stroke-linecap",
"stroke-linejoin", "stroke-miterlimit", "stroke-dasharray",
"transform", "style", "version", "viewBox", "width", "height",
"xmlns", "x", "y", "x1", "x2", "y1", "y2", "id", "d", "cx", "cy",
"r", "points", "rx", "ry", "enable-background", "xml:space",
"xmlns:xlink", "data-name", "role", "class", "opacity",
"fill-opacity", "stroke-opacity"
]:
echo k, ": ", v
if node.attrs() != nil:
for k, v in node.attrs():
maybeLogPair(k, v)
let pairs = style.split(';') let pairs = style.split(';')
for pair in pairs: for pair in pairs:
let parts = pair.split(':') let parts = pair.split(':')