Skip to content

Commit

Permalink
tools/clean_svg: do not convert plain integers to floats
Browse files Browse the repository at this point in the history
It seems that this breaks some SVG paths, and the nice looking arrows
get converted into an uggly triangle
  • Loading branch information
bentiss committed Oct 16, 2024
1 parent 34bd864 commit 5dc6699
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/clean_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@

def human_round(number):
"""
Round to closest .5
Round to closest .5, keep integer values
"""
return round(number * 2) / 2.0
v = round(number * 2) / 2.0
return int(v) if v == int(v) else v


def traverse_and_clean(node):
Expand Down

0 comments on commit 5dc6699

Please sign in to comment.