Keep Inkscape from turning my transformations into matrices

Asked by Alexander Krivács Schrøder on 2007-12-24

I'm drawing SVG manually, but I'm using Inkscape for the job since it shows me how the outcome is immediately. However, I have one problem. When modifying/creating a "transform" attribute, and entering something like "scale(-1,1) translate(-100,-100)" into it, it is automatically converted into "matrix(-1,0,0,1,100,-100)". This is probably done because it is more economical, but it bugs me, because I, as a human, find it a lot easier to see transformations as steps (i.e. scale like this, then translate like that) instead of a matrix transformation.

Please tell me there is a way to stop Inkscape from doing this. I want to keep my transformations just like I enter them.

Question information

Language:
English Edit question
Status:
Solved
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Solved by:
Bryce Harrington
Solved:
2007-12-30
Last query:
2007-12-30
Last reply:
2007-12-29
Best Bryce Harrington (bryce) said : #1

Unfortunately due to the underlying mathematics-handling code, there isn't a way to disable this behavior.

When loading a document, scale(), translate(), etc. are converted into their appropriate matrix representations and stored in a unified matrix structure internally. Then later when outputting the document it uses the more general purpose matrix() format.

I think you're right that this is a bit annoying when using Inkscape for editing manually created SVG's. It's probably not been an important issue since most people aren't doing manual SVG editing, however I think it would be nice if it could handle this situation better.

There is an option in 'Inkscape Preferences' under Transforms to store transformation as 'optimized' or 'preserved'. Setting to preserved makes it preserve the scale() settings, however if you also move the object, then it converts scale() into a matrix().

I'll file a bug for you with a request to implement this feature.

As a workaround, perhaps you could create a script that parses the Inkscape-outputted SVG and replace the matrix() calls with the corresponding scale() and translate() equivalents.

The script solution will only partially help, because a matrix hides consecutive similar operations. Say I do a translate, scale, translate. This series of events will be lost when converted into a matrix and back. Also, some different operations affect the same values in the matrix, making my job even worse.

Thanks for filing it as a feature request. I didn't want to do that until I was certain it was not already doable.

(And this question system needs a "Problem unsolvable" button.)

Thanks Bryce Harrington, that solved my question.