Skip to content

Commit b32ab68

Browse files
committed
Close SVG polygons
1 parent 753a8b9 commit b32ab68

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pygexml/svg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class SVGError(Exception):
1212

1313

1414
def _coords_path(coords_str: str) -> str:
15-
return f"M {coords_str}"
15+
return f"M {coords_str} Z"
1616

1717

1818
def _baseline_path_d(line: TextLine) -> str:

test/test_svg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def test_page_to_svg_coords_path() -> None:
101101
assert region_g is not None
102102
path = region_g.find(f"{{{SVG_NS}}}path")
103103
assert path is not None
104-
assert path.attrib["d"] == "M 0,0 10,0 10,10 0,10"
104+
assert path.attrib["d"] == "M 0,0 10,0 10,10 0,10 Z"
105105
assert path.attrib["class"] == "Coords"
106106

107107

0 commit comments

Comments
 (0)