scour-project / scour

Scour - An SVG Optimizer / Cleaner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The --set-precision option is confusing

mrmeszaros opened this issue · comments

Hey,
As I understand precision controls the number of significant digits.

However, this means that close to zero, the grid is finer, while farther away it gets coarser. For example:

<svg>
  <path d="m 100.501 .999"/>
</svg>

Now if I run it with --set-precision=3, it produces the following:

<svg>
  <path d="m101 0.999"/>
</svg>

I suggest to either change the behavior to round to decimal places, or to introduce a new option that implements that kind of rounding.

For example: --set-rounding=N will round numbers to the nearest 1e-N. This would work like python's round built-in method.

Basically a duplicate of #141.

See comments there for some thoughts.