Dynamic Offset ignores document units

Bug #1669360 reported by Vlad Barsukov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

When manually setting up the value of "inkscape:radius" in XML-Editor (Shift+Ctrl+X) it is always corresponds to "mm" units.

My system is: Windows 7 Professional (SP1) x64
My Inkscape version is: 0.92.0 r15299

Issue may be noticed doing same steps in two (or more) differently set properties of document:

Case 1
1. Document Properties (Shift+Ctrl+D) -- Page -- General -- Display units : "mm"
2. Creating rectangle any size you wish, mine is: W: 10 mm; H: 5 mm
3. Duplicate object (Ctrl+D)
4. Applying Dynamic Offset (Ctrl+J)
5. Open XML-Editor (Shift+Ctrl+X)
6. Setting value for "inkscape:radius" to 1
7. Checking dimensions of that new object: W: 12 mm; H: 7 mm
Conclusion:
All fine as expected W = 10 + 2 * 1 = 12 mm; H = 5 + 2 * 1 = 7 mm.

Case 2
1. Document Properties (Shift+Ctrl+D) -- Page -- General -- Display units : "px"
2. Creating rectangle any size you wish, mine is: W: 100 px; H: 50 px
3. Duplicate object (Ctrl+D)
4. Applying Dynamic Offset (Ctrl+J)
5. Open XML-Editor (Shift+Ctrl+X)
6. Setting value for "inkscape:radius" to 1
7. Checking dimensions of that new object: W: 107.562 px; H: 57.557 px
Conclusion:
δW = 107.562 - 100 = 7.562 px which is roughly 2 * 3.779527559 (approximate "mm" to "px" conversion rate)
δH = 57.557 - 50 = 7.557 px (!) Why not the same? (Side question)

I wouldn't like do describe all other cases for rest of units, I've check some (cm, pt) and convinced Application treat value as "mm" unit always

Revision history for this message
Eman Modnar (eman-mod) wrote :

I found that when you change display unis in the Document Properties dialog, the scale factor also changes. Set the scale factor in the same dialog to 1 when you change mm to px and you should be able to change "inkscape:radius" in proper units.

Caution, all document contents are scaled proportionally to the factor if you change it from the value that Inkscape offer to you.

Revision history for this message
Vlad Barsukov (rinchenchonyi) wrote :

Like a charm!
Thank you for the clue.

P.S.
About "Caution" part: you put me in stunt for a while.
It was difficult for me to understand,
but I did series of experiments and now I see:

Let's have square [10 x 10 mm] in document with "mm" units;
(remark: let's assign X=0; Y=0 )

case 1:
When we change units let's say from "mm" to "px"
Inkscape preserves created object dimensions "as is" so our 10mm becomes 37.795px.
Our square now [37.795 x 37.795 px]
and it hasn't change its location.
"Scale factor" appears to make this kind of conversion,
in our case it is auto-become "0.26458" ("Scale x" in Scale section of Document Properties (Shift+Ctrl+D) as well as "Scale y" (!) )

case 2:
Alternatively changing units from "mm" to "px" and manually override "Scale factor" ("Scale x") to "1" will give us objects with the dimensions of the same values as we've entered creating them but for other units ("px")
"Physically" objects are scaled to suite new chosen units.
Me personally would prefer case 2 much more (because I'm addicted AutoCAD user (my main job), and I used for such behavior for ages)))
But here I found one unpleasant "stepping stone":
Inkscape keep "Scale y" dimmed, so then my everything "jumps" in ordinates after unit changing manipulation!
Our square become [10 x 10 px]
but coordinates now: X=0; Y=825.520 (Why?! I didn't solve this since it is "0" initially!?)

P.P.S.
Please help me:
Personally me can live with this ))) but ...
May it be considered as bug or am I miss something?

I can feel phrase mentioned near "Scale":

"While SVG allows non-uniform scaling it is
recommended to use only uniform scaling in
Inkscape. To set a non-uniform scaling, set the
'viewBox' directly."

should explain everything (why "scale y" is dimmed), but if I understand the meaning proper it causes exactly what it should prevent!

tags: added: non-uniform-scaling scale-factor units
Revision history for this message
Eman Modnar (eman-mod) wrote :

I thinks this behavior is result of how Sodipodi treated the coordinate system. Inkscape inherited this 'cartesian coordinates' where the Y axis is upward in contrast to SVG standard and other software where Y axis is downward.

You can read more about this 'feature' here: https://bugs.launchpad.net/inkscape/+bug/170049

If you take a closer look at coordinates of your "zero-located" object you could find in XML Editor that the Y-coordinate is not actually equal to zero. And this is why your objects "jump".

What about dimmed Y-scale — it is used for non-uniform document scaling and normally shouldn't be used. I personally have never seen documents like that. Even if you set Y-scale to -1 it will not help you to avoid "jumping" as the origin of a document is misplaced in SVG terms.

I recommend you to setup document units before doing any graphics.

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.