Skip to content

Commit

Permalink
Now works with example including curves and relative commands
Browse files Browse the repository at this point in the history
  • Loading branch information
petercollingridge committed Feb 1, 2012
1 parent 04fd112 commit 48c8cdd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
4 changes: 3 additions & 1 deletion cleanSVG.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ def _translateElement(self, element, delta):

for n, value in enumerate(values):
command_str += "%s " % self._formatNumber(value + delta[ d[n % len(d)]])
else:
command_str += " ".join(map(self._formatNumber, values))

print command_str
element.set("d", command_str)
Expand All @@ -260,8 +262,8 @@ def main(filename):
svg = CleanSVG(filename)
#svg.removeAttributes('id')
#svg.removeNamespace('sodipodi')
#svg.setDecimalPlaces(1)
#svg.extractStyles()
svg.setDecimalPlaces(1)
svg.applyTransforms()
svg.write('%s_test.svg' % filename[:-4])

Expand Down
32 changes: 24 additions & 8 deletions examples/paths.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 48c8cdd

Please sign in to comment.