Unit tests for removing trailing zeroes and removing whitespace/commas before negative coords in path data
This commit is contained in:
parent
5d7e3a075c
commit
d6d4d3d027
3 changed files with 19 additions and 2 deletions
4
scour.py
4
scour.py
|
|
@ -64,7 +64,6 @@ import math
|
|||
import base64
|
||||
import os.path
|
||||
import urllib
|
||||
import svg_regex
|
||||
from svg_regex import svg_parser
|
||||
|
||||
APP = 'scour'
|
||||
|
|
@ -630,7 +629,8 @@ def serializePath(pathObj):
|
|||
# if coord can be an integer without loss of precision, go for it
|
||||
if int(coord) == coord: pathStr += str(int(coord))
|
||||
else: pathStr += str(coord)
|
||||
if c < len(data)-1:
|
||||
# only need the comma if the next number if non-negative
|
||||
if c < len(data)-1 and data[c+1] >= 0:
|
||||
pathStr += ','
|
||||
c += 1
|
||||
except TypeError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue