
On 2013-03-22 03:48, Krzysztof KosiĆski wrote:
The loss of precision mentioned by Jasper is actually something we need to keep, because otherwise the document would change slightly when reloaded. (Either that or always write out numbers with full precision.)
Not necessarily. There are all sorts of solutions imaginable that avoid changing the document slightly when reloading it while also avoiding loss of precision when repeatedly changing a value. For example, one could store the original string and clear it whenever the value changes, regenerating it only when requested. True, if one then saves the file and transforms a shape there is still some loss of precision compared to directly applying the second transform and then saving, but that should typically be hardly noticeable. (And in my mind it's better to be precise when one is able to.)
A different option would be to somehow ensure that everything is constrained in such a way that it is always "precise" up to a given tolerance, but that is probably going a bit too far.
A more pragmatic option to avoid the discrepancy between floats and serialized values is to use a binary format. For example an EXI encoding of the SVG document. To me this would make the most sense, as it solves a host of "silly" problems and is typically more efficient.