object size changes with page format

Bug #168703 reported by David-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Incomplete
Undecided
Unassigned

Bug Description

I'm using inkscape to annotate a floor plan I've created with cairo. The
size of the objects in my floor plan change when I change the page format.
For example, if I generate a square intended to print as 1" on a side, it
initially is the correct size when I open the svg file with inkscape.
However, after I pick a page format (eg: US Letter), the size of the square
changes significantly. I will attach some C code that generates an svg
file with a 1" square as an example. Somebody responded to a mailing list
query about this problem saying it was a problem with the viewport ...
deleting the viewport section of the svg file helps the problem, but the
scaling is then incorrect (but invariant with document format).

Tags: svg
Revision history for this message
David-16 (david-16) wrote :
Revision history for this message
Bryce Harrington (bryce) wrote :

Could you please also attach a screenshot and/or svg output to demonstrate what you're seeing?

Changed in inkscape:
status: New → Incomplete
Revision history for this message
David (idht4n) wrote :
Revision history for this message
Tom Davidson (tjd-mit) wrote :

Are you sure this is a bug in inkscape? Your document specifies a viewBox="0 0 100 100" , which means that it is requesting that that region of the drawing be scaled to fit the current document (as I understand: http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute ). When you remove that viewbox, the rectangle is drawn as it is specified in the file, which is from 10,10 to 82,82 pixels.

I think the problem is that you are relying on an interaction between the viewbox and the paper size to get your scaling right, in which case the behavior you describe above is unavoidable.

Revision history for this message
David (idht4n) wrote :

Perhaps it is a user bug... I don't know enough about svg. I posted a question to the
mailing list about 8 months ago and got this response:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
On 5/30/07, David L <email address hidden> wrote:
> understand exactly what's going on. Is this a bug or an
> intended behavior? It seems odd that objects are resized
> when the page format changes.

Yes it's a bug. Inkscape never uses viewBox itself and its support for
this attribute is quite poor.

--
bulia byak
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I had a nicely annotated floorplan that I had to print on 24"x36"
paper because that's what the city requires and the scaling changed when
I changed the paper size. I originally created the floorplan using cairo's
svg output which seems to always put the viewbox in the file. I ended up
removing the viewbox section with awk after exporting the svg file... but
then the scaling was wrong for some reason, so I had to prescale it in my
CAD program to compensate for the re-scaling (I think I multiplied by 90/72).
(Notice that if you remove the viewbox, the number of pixels changes from
90 to 72).

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.