
Hi Bric,
Yes, you're correct. The x/y values are being translated, scaled, rotated, and/or sheared by the transform matrix. These pages on Wikipedia should help you to get started: http://en.wikipedia.org/wiki/Transformation_(geometry) and http://en.wikipedia.org/wiki/Transformation_matrix
Also, it's not just the transform matrix on the object itself that you need to think about. If the text object is part of a group or a layer, then if there's a transform matrix on any of its parent groups or layers, they'll affect the object cumulatively.
I've written Python code to handle all these scenarios in the Pixelsnap extension. Have a look at the code for that if you want.
- Bryan
On Sun, Jan 9, 2011 at 17:15, Bric <bric@...2538...> wrote:
Hi, all.
I am trying to use a script to edit inkscape SVG code, and mostly succeeding, except with coordinate values.
Specifically, with text objects, there seems to be some tricky function generating the "x" and "y" values (object coordinates). The function seems to be tied to the transform values. With no transformation in effect (theoretically, with the matrix being (1,0,0,1,0,0) -- i say theoretically because the line is absent when these are the (implied) values), the "x" and "y" values are what one would expect, when one drags the object left and right, up and down. The x and y values change in the expected manner. However, when the text object gets transformed, as in the example below:
transform="matrix(0.42584538,0.90479595,-0.90479595,0.42584538,0,0)">
transform="matrix(0.42584538,0.90479595,-0.90479595,0.42584538,0,0)"
the x and y values become severely strange... Dragging the text object vertically affects the x value (as well as the y value), and horizontal drag affects both as well. The values become negative in an unexpected way. And visually, the objects are not where the script attempts to place them.
Could someone please clue me in about the function (the math of it)?
thanks in advance
Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel