Inkscape: A Vector Drawing Tool

page resize adds offset to svg output

Reported by Michael Harris on 2012-05-08
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Wishlist
Unassigned

Bug Description

When using default page size (744.09,1052.36) for the svg file, the svg origin is at the top left

a bitmap image with its top left corner lined up with top left corner of the inkscape page will show as expected:
transform="translate(0,0)"

after a document page resize to (1920,1280)
a bitmap image with its top left corner lined up with top left corner of the new inkscape page will show unexpectedly:
transform="translate(0, -227.64)"

since this is svg output the top left of the document should report as (0,0)

what appears to be happening is the svg output is maintaining the top left of the default document (0, 1052.36) as the svg origin (0,0) and anything above this point is negative.

When I resize a document I keep no memory of the previous document size and so the svg output becomes confusing.
This along with the fact that svg top left point should report as (0,0) leads me to report this as a bug.

-Thank You

(note: preferences-transforms-store transformations-preserved is set)
-----
I discovered this issue when trying to perform matrix rotation,scaling and translation and was getting very confused by the translated (x, y) coordinates appearing in the svg output.
I imagine this could be causing a lot of people to incorrectly report this as a matrix rotation/rotation/scaling bug...

Thanks again

~suv (suv-lp) wrote :

> This along with the fact that svg top left point
> should report as (0,0) leads me to report this as a bug.

Not a bug - technically it is regular SVG to apply a 'transform' attribute to top-level containers (groups, or layer groups).
Setting bug status to 'Wishlist'.

tags: added: transformations
Changed in inkscape:
importance: Undecided → Wishlist
~suv (suv-lp) wrote :

> since this is svg output the top left of the document should report as (0,0)

Since the GUI uses a differently oriented coordinate system (first quadrant of the normal Cartesian coordinate system), the "fixed point" when changing the page size is not the SVG origin (originally at the upper left corner of the page), but the GUI origin at the lower left corner of the page.

(Yes, requests to use the same coordinate system for the GUI as defined in the SVG specification have been filed multiple times, and the feature is on Inkscape's roadmap).

> When I resize a document I keep no memory of the previous
> document size and so the svg output becomes confusing.

Not within Inkscape's GUI though (unless you are in advanced editing mode and add hand-written code via XML Editor, or edit the SVG file later-on externally).

Tip: To get "rid" of the transform attributes on top-level layers, create new layer(s) after the page resize, and move the content of existing layers to new layers (which won't have a transform attribute until the next time the page height or orientation, or the position of the lower left corner (resize to selection) is changed).

Note: after moving a selection of objects to a new layer without transform attribute (with 'Shift+PageUp/PageDown'), the layer transform will be transferred to the individual objects of the moved selection. Depending on their type,
- this transform will stick (inkscape shapes, clones, offsets, …)
- can be flattened by ungrouping and regrouping (groups)
- can be optimized (flattened) by forcing a rewrite of the path data e.g. by nudging the selection with the arrow keys (regular paths only)

You can also create custom templates with your preferred page formats, and remove the 'transform' attributes of the default layers before saving them into '~/.config/inkscape/templates'.

~suv (suv-lp) wrote :

Related to (or duplicate of?):
Bug #421870 “Allow users to strip out Transform attributes with command”
<https://bugs.launchpad.net/inkscape/+bug/421870>

~suv (suv-lp) wrote :

> (…) Depending on their type,
> - this transform will stick (inkscape shapes, clones, offsets, …)

For Inkscape shapes (circle/ellipse, star/polygon, spiral) tracked in
Bug #233935 “Moves of circle stored in transform Attribute”
<https://bugs.launchpad.net/inkscape/+bug/233935>

Michael Harris (mwharris333) wrote :

Ok. Thanks for the info and quick response.

Eduard Braun (eduard-braun2) wrote :

> Not a bug - technically it is regular SVG to apply a 'transform' attribute to top-level containers (groups, or layer groups).

This even happens if the top-level container (e.g. the layer) is empty, see bug #1165829. At least in this case it should be considered a bug I think.

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

Other bug subscribers