Merge pull request #31 from pingswept/main

Accept px as units
This commit is contained in:
Paint Your Dragon 2023-08-08 09:11:46 -07:00 committed by GitHub
commit 80de2c0a9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1028,12 +1028,16 @@ def parse(fzpz, circuitpydef, pinoutcsv, arduinovariantfolder, substitute):
svg_width = 25.4 * float(svg_width[:-2]) * MM_TO_PX
elif "mm" in svg_width:
svg_width = float(svg_width[:-2]) * MM_TO_PX
elif "px" in svg_width:
svg_width = float(svg_width[:-2])
else:
raise RuntimeError("Dont know units of width!", svg_width)
if "in" in svg_height:
svg_height = 25.4 * float(svg_height[:-2]) * MM_TO_PX
elif "mm" in svg_height:
svg_height = float(svg_height[:-2]) * MM_TO_PX
elif "px" in svg_height:
svg_height = float(svg_height[:-2])
else:
raise RuntimeError("Dont know units of width!", svg_height)