viewBox numerical errors caused by default.svg file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Medium
|
Alvin Penner | ||
0.91.x |
Fix Released
|
Medium
|
Alvin Penner |
Bug Description
- running Windows XP, Inkscape rev 13632.
In rev 13632 some efforts were made to reduce conversion errors caused by using float variables. However some errors still remain, and appear to be caused by the default file default.svg. This has been attached here with the name default_bzr.svg for reference purposes. If I load Inkscape with no file, open Document Properties, and switch from Page Size A4 to Letter, then the viewbox height, in the XML editor, is 990.00002. It should be 990 exactly. This appears to be related to the default.svg file. This file has two deficiencies.
The first deficiency is that the file does not survive a round trip caused by switching from Page Size A4 to Letter and back again. During the original load, when the Page Size was A4, the document height is reported in pixels in the XML editor. After switching to Letter, the height is reported in inches as expected. When switching back to A4, the height is reported in mm, as expected. This means it should have been mm in the first place, during the initial load, to be consistent.
The second deficiciency is that there will be round-off error in the calculated viewBox, if it does not initially exist. If it does not exist, then it will be calculated from the document height. But the document height is a single-precision float variable, while the viewBox is declared to be, intended to be, a double-precision variable. It will therefore inherit the imprecision of the height variable, and once this error is committed, it can never be undone.
Related branches
Changed in inkscape: | |
importance: | Undecided → Medium |
milestone: | none → 0.91 |
status: | New → Confirmed |
Changed in inkscape: | |
status: | Confirmed → Invalid |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
These deficiencies have been fixed in the attached file default.svg.
Using this file to start Inkscape, we get the following viewBox in the XML editor: 0 0 744.09448819 1052.3622047.
This is an exact duplicate of the default.svg file, so no error has yet been committed.
After toggling page size back and forth between A4 and Letter, no new errors are introduced in ViewBox.
After toggling default units back and forth between px and mm, no new errors are introduced in ViewBox.
I would like to propose using the new version of default.svg.
My main problem is, I do not know exactly who will be affected by this, since there are so many versions of default.??.svg, none of which apparently affect my install. Therefore I thought I would post this here for comment.