Note that there are some explanatory texts on larger screens.

plurals
  1. POFlattening SVG matrix transforms in Inkscape
    primarykey
    data
    text
    <p>I have a free clip art SVG file originally created in Inkscape which I'm making modifications to for use in a Windows 8 JavaScript game. It contains numerous instances of a path with a matrix transform applied on a surrounding group, like this:</p> <pre><code>&lt;g transform="matrix(0.443,0.896,-0.896,0.443,589.739,-373.223)"&gt; &lt;path d="M486,313s27-9,43-29l26,4,1,23-22,5s-25-6-48-3z" /&gt; &lt;/g&gt; </code></pre> <p>I want to flatten that transform by applying it in advance to the path in Inkscape, to reduce browser work during animation. However when I plug the 6 matrix values into the A B C D E F parameters in Inkscape and apply it, it gives the path a completely different rotation and scaling to what the IE10 engine does.</p> <p>I have checked numerous times that I have the 6 values mapped correctly. What am I doing wrong?</p> <p>EDIT: OK, here are before and after screenshots from IE10 and Inkscape. For the IE10 case, the SVG resides directly inside the body of an otherwise empty HTML document (the rendering is exactly the same in Firefox). In Inkscape, I simply opened the "before" SVG file which contains only the path element, selected the path, and plugged in the 6 matrix transform values into Object > Transform > Matrix. I know very little about matrices, I just want to be able to pre-apply these transformations in the same way the browser does, and ideally to understand why there is a difference in Inkscape. Thanks.</p> <p><img src="https://i.stack.imgur.com/o3It1.png" alt="IE10 path only"> <img src="https://i.stack.imgur.com/31oF5.png" alt="IE10 path with transform"> <img src="https://i.stack.imgur.com/D7p2j.png" alt="Inkscape path only"> <img src="https://i.stack.imgur.com/VoKFR.png" alt="Inkscape path with transform"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload