errors in numeric scaling of open lines

Bug #168247 reported by Bug Importer
0
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

Using Inkscape 0.44.1, I have created objects and tried to precisely place
them. As I type one coordinate (X, Y, H-size or V-size), one or more of
the others change by themselves. I have tried this with my units set to mm
and to px, in different drawings, with the same results. To my surprise,
the problem was worse (that is, the coordinate change was greater) using
pixels, than it was when using millimeters.

Sometimes the coordinate that I am changing, changes when I press the Enter
key. For instance, I had a vertical line, position was X=45.8mm, Y=2.0mm,
H=0.4mm, V=136mm. Getting the H parameter to STAY at 0.4mm, required five
or six interations of selecting the H field, typing "0.4" , hitting Enter,
and watching it asymptotically approach 0.4 (0.443, 0.421, 0.410, 0.405,
0.403, 0.401, 0.401, 0.400 (FINALLY!)). Then I had to play with X, Y, and
V, and H again, until finally they were all stable at the desired values.

Is this the result of floating-point inaccuracies when changing to/from the
SVG default units of measurement? What are they, anyway?

Revision history for this message
Bug Importer (bug-importer) wrote :

Oh, forgot to mention: this copy of Inkscape is being used on a laptop
running Micro$oft Windows XP Pro, Service Pack 2.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

The reason is that the object has stroke and the stroke width is scaled
when you change width/height. SVG specifies that stroke must be scaled when
the object is scaled, and we must obey that. Inkscape has "non-scaling
stroke" switch which just calculates the necessary compensation and applies
it to stroke width so that it _looks_ the same width after the
transformation. This calculation is not exactly trivial in itself (involves
solving a quadratic equation) and currently works properly only for closed
objects without long meters, such as rectangles. For open lines, it's a
quite different calculation which, among other things, must take into
account the angle of the line and what kind of caps it has (because
different caps protrude to different distance, affecting the bounding box).
This is going to be rather difficult and is not implemented yet. At least
it's not likely to be implemented until we fix this bug:

https://sourceforge.net/tracker/index.php?func=detail&aid=1023629&group_id=93438&atid=604306

Also we are thinking about enabling a no-stroke bounding box as an option
(though in this case, your vertical line will have zero width and thus no
bounding box as such).

Revision history for this message
Bug Importer (bug-importer) wrote :

Pursuant to buliabyak's explanation of the background of this problem: So,
when one changes the size of an object, one is (according to SVG specs)
scaling it? But when I changed its position, its size changed also! That
seems unreasonable.

It would seem that if one wants an object placed/sized precisely, one must
create it with that size and in that place, else abandon hope.

Might I suggest that there should be a mode or something wherein one is
placing/sizing an object and scaling is not applied?

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

I could not reproduce this. I selected a vertical straight line and moved
it by entering values in the X and Y fields in the toolbar, and the W and H
remained unchanged. If you are seeing a situation where W or H change,
please give detailed steps to reproduce and attach a sample file.

Revision history for this message
Bug Importer (bug-importer) wrote :

I could not reproduce it either. Changing H or V often alters X and Y,
but changing X and Y did not change H or V when I was paying attention.

I am forced to the conclusion that I mis-remembered exactly what was
changing by itself, when I was resizing and moving my objects, because I
was frustrated by my expectation that a number I typed in exactly, would
remain stable.

On the other hand, I did find an item in the Inkscape Preferences, under
Transforms: "Scale stroke width". Turning that OFF, makes straight lines
(in any orientation) keep their stroke width when I move or resize them.
It worked for more complex shapes also. This item would seem to answer my
plea for a no-scaling mode.

This is beginning to sound like a luser error, not a bug. My apologies
for wasting your time.

Revision history for this message
Bryce Harrington (bryce) wrote :

Originator: NO

Thanks for replying back with an update on the issue! Since it sounds
from what you've reported that this is not a bug, I'm going to go ahead and
close it. If there are issues you know of that are definitely bugs though,
please enter new bug reports on them.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.