unexpected results when changing document units on a loaded svg file that already has a viewBox defined

Bug #1280684 reported by Alvin Penner on 2014-02-15
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

- Windows XP, Inkscape rev 12991
- attached is an svg file from Bug 803791
- it has the following properties
     viewBox="-75 -50 465.04091 170.99168"
     default document units = px

Alvin Penner (apenner) wrote :
Alvin Penner (apenner) wrote :

- upon changing the document units from px to mm one would normally expect the reported size of all objects to change by a factor of 25.4/90 = .2822222, so the size of the document would change from

(2500 x 1437.5) px to (705.5 x 405.7) mm

Instead, when the document units are changed to mm, one gets the file Wrongpaths_mm.svg.
The size of the black rectangle which represents the original document, is now reported as being 131.245 mm by 75.466 mm. (This is coming from the W: and H: spinboxes on the top menu after pushing F1.) This is much smaller than expected. These numbers are somewhat consistent with taking the viewBox width and scaling it by .2822222 but that is not what was expected.

su_v (suv-lp) on 2014-02-15
tags: added: regression units viewbox
su_v (suv-lp) wrote :

On OS X 10.7.5:
- not reproduced with Inkscape 0.48.4
- reproduced with trunk r13029

Reminds me of bug #1236257 (similar effect on drawing content if default units are changed).

Changed in inkscape:
importance: Undecided → High
milestone: none → 0.91
status: New → Confirmed
Alvin Penner (apenner) wrote :

a partial fix has been committed to rev 13034. When changing document units, If the viewbox already exists, then it will be rescaled to produce the new viewbox. If it does not exist then the page size will be used as before.

there is still a remaining problem, namely offset of the origin during the rescaling. This appears to be a separate issue.

Alvin Penner (apenner) wrote :

fix for offset problem has been committed to rev 13050

Changed in inkscape:
status: Confirmed → Fix Committed
Bryce Harrington (bryce) on 2015-02-21
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers