Rounding errors when moving a path
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
New
|
Undecided
|
Unassigned |
Bug Description
When moving around a path with the mouse (even if the path is defined using relative coordinates) from time to time multiple coordinates show rounding errors.
E.g. I started with a simple rectangular path with nodes defined by
m 0,0 100,0 0,-100 -100,0 z
After dragging the path with the mouse the coordinates changed to
m 60.000004,
This clearly illustrates that when moving a path, all coordinates are recalculated leading to rounding errors. Instead in such a simple case, Inkscape should probably only attempt to change the first two coordinates, since this is totally sufficient to translate a path.
I'd even propose the behavior to *always* convert a path to relative coordinates before translating, then translate by changing only the coordinates of the first node and then (if necessary) convert back to absolute coordinates.
I agree that seeing numerical error like this is extremely annoying. However, I don't think that it is completely clear that switching from absolute coordinates to relative coordinates will actually solve the problem. For example if that were the case then in the example you gave:
m 60.000004, -28.571429 99.999996,0 0,-100.000001 -99.999996,0 z
one would expect that the first number should be 60, not 60.000004. The roundoff error in all the other numbers can be blamed on relative/absolute conversions, but the first number is not affected by such conversions, so there may be some other roundoff problem that is to blame.