Skip to content

Commit

Permalink
SVG: Emit part names as title
Browse files Browse the repository at this point in the history
In web browsers, this shows tooltips when the cursor hovers over lines
of a part.
  • Loading branch information
chrysn committed Mar 5, 2024
1 parent 79c95ad commit ac930cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions boxes/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ def finish(self, inner_corners="loop"):
continue
g = ET.SubElement(svg, "g", id=f"p-{i}",
style="fill:none;stroke-linecap:round;stroke-linejoin:round;")
if part.name:
ET.SubElement(g, "title").text = part.name
g.text = "\n "
g.tail = "\n"
for j, path in enumerate(part.pathes):
Expand Down

0 comments on commit ac930cf

Please sign in to comment.