parent
81be7d477b
commit
a0d2a8c470
|
@ -40,8 +40,12 @@ def extract_zooms(src_folder):
|
||||||
tree = ET.parse(svg_path)
|
tree = ET.parse(svg_path)
|
||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
|
|
||||||
zooms[idx]["width"] = int(root.get("width"))
|
if "." in root.get("width"):
|
||||||
zooms[idx]["height"] = int(root.get("height"))
|
print(f"WARNING: file {svg_path} has a floating width, it will be rounded", file=sys.stderr)
|
||||||
|
zooms[idx]["width"] = round(float(root.get("width")))
|
||||||
|
if "." in root.get("height"):
|
||||||
|
print(f"WARNING: file {svg_path} has a floating height, it will be rounded", file=sys.stderr)
|
||||||
|
zooms[idx]["height"] = round(float(root.get("height")))
|
||||||
|
|
||||||
for area in root.findall('.//{*}rect'):
|
for area in root.findall('.//{*}rect'):
|
||||||
zooms[idx]["zooms"].append([
|
zooms[idx]["zooms"].append([
|
||||||
|
|
Loading…
Reference in New Issue