imprecision in snapping to a grid when document units are mm, rev 13918
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Invalid
|
Medium
|
Unassigned |
Bug Description
in revs 13868, 13876, 13881, 13896, 13900, 13918, some changes have been made to improve the precision of the viewbox scaling calculation, and the process of snapping to a grid or guide. These changes have worked well for the case of snapping to a grid if the document units are px, see following comment.
However, if the document units are mm, which is the default, then snapping to a grid is still imprecise. Attached is a demo file. This was obtained from the file default_mm.svg, after adding a grid of 1 mm. Then a multi-line Bezier path was drawn, consisting mostly of lines, more or less randomly, with snapping enabled.
A significant number of the lines contain round-off error in the last digit. It is worth noting that the error can be either plus or minus, and that it can affect either x or y, so it is essentially random, not related to systematic error in a grid spacing, for example, nor related to turning the page upside down.
This test was done with Preferences-
Changed in inkscape: | |
status: | Confirmed → Triaged |
Changed in inkscape: | |
status: | Triaged → Invalid |
the problem does not occur if the document units are px. The attached file was produced by loading the file default_px.svg. Then add a grid with a spacing of 5 px. Then set the page height to an integer number of px, in this case 1123. This is to avoid non-integer numbers when inverting the y axis. Then delete any translate transforms that may have acumulated in Layer 1, again to avoid non-integer offsets. Then draw a random set of Bezier lines. The result is attached, using the default numeric precision of 8.
this drawing contains only integer coordinates, as expected.