Remove trailing zeros from path coordinates. Use scientific notation in path coords if shorter. Scour polygon coordinates just like path coordinates. Added tests
|
|
@ -1,3 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" version="1.1">
|
||||
<path d="M 100.0000001 99.9999999 h100.001 v123456789.123456789 h-100 z" fill="red" />
|
||||
<path d="M 100.0000001 99.9999999 h100.01 v123456789.123456789 h-100 z" fill="red" />
|
||||
</svg>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 227 B |
4
unittests/path-truncate-zeros-calc.svg
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="5 0 3 3">
|
||||
<path stroke="blue" stroke-width="0.01" fill="none" d="M5.81,0 H5.91000" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 199 B |
|
Before Width: | Height: | Size: 108 B After Width: | Height: | Size: 108 B |
4
unittests/path-use-scientific-notation.svg
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="5 0 3 3">
|
||||
<path d="M10000,0" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 145 B |
4
unittests/polygon-coord.svg
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<polygon fill="blue" points="10000,-50" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 146 B |
|
|
@ -1,3 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<polygon fill="blue" points="50,50 150,50 150,150 50,150 +5e1,500.00e-1" />
|
||||
<polygon fill="green" points="200,50 300,50 300,150 200,150" />
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 244 B |