transformation inaccuracies
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I noticed the transformations applied to objects is
quite inaccurate:
<rect
width=
height=
x="100.000000"
y="100.000000"
style="
uot;
id="rect562" />
Opening the transformations dialog and applying 10
horizontal gives this:
<rect
width=
height=
x="112.500000"
y="99.9999695"
style="
uot;
id="rect562" />
Also, If I take that original square and rotate it 10,
I get this:
<rect
width=
height=
x="62.2319183"
y="131.691177"
transform=
00)"
style="
uot;
id="rect562" />
Why have x and y changed? Shouldn't the matrix handle
all aspects of the transformation and leave x and y as
they were?
Re ".9999" with translation:
I have made it use doubles rather than floats for some of
the calculation, which reduces the error in this case to
small enough not to show up in the decimal representation.
Of course better would be to reduce the number of
conversions between coordinate systems; nevertheless, using
doubles is a sufficient fix for this particular example, and
I'm content to consider that part of the bug report addressed.
Re adding 12.5 rather than 10: www.w3. org/TR/ REC-CSS2/ syndata. html#length- units).
the default unit for SVG diagrams is a CSS2-style "pixel"
(see
http://
If translation is only to change the coordinates rather than
introduce a new coordinate system, then taking 1px to be a
fixed length of 1/90 of an inch is probably the best thing
to do.
Possible improvements:
- Add a new item to the Units popup menu that uses the
shape's coordinate system, allowing a closer correspondance
between the number in the dialog box and the change in the
XML. However, I don't know if this is possible if multiple
shapes are selected (possibly having different coordinate
systems).
- Don't convert between different bases (absolute vs
angular etc.); add an explicit transform if necessary.
Re rotation: I haven't checked the maths, but visually the
behaviour appears correct: it is rotating the shape about
the shape's centre, which makes the top-left coordinates change.