On 9/27/07, Maximilian Albert <Anhalter42@...173...> wrote:
P.S.: Could someone give me a very quick introduction of how transforms generally work in Inkscape and how objects are supposed to handle them? My somewhat vague understanding so far is that a transform is just a matrix representing an affine transformation that is updated (if necessary) when objects are moved or resized. But in what situations does this matrix turn out to be different from the identity matrix (i.e., when can't the transformation just be applied to the objects' coordinates directly?) and what precisely is supposed to happen in the transform methods in this case? Most of them don't even seem to be present for the "regular" shapes such as ellipses, stars, etc. Thanks!
This is controlled by the "Store transformations" preference. If set to "preserved", only the transform= attribute is always updated when an object is transformed. No embedding is ever attempted. If it is set to "optimized" (default), it attempts to embed as much as possible of the transform into the object. How much is embedded depends on the object type. With paths, all of the transform is applied directly to the path nodes, so the transform= attribute is eliminated completely. For rects, scale and move components are embedded into x/y/w/h attributes, but rotates and skews are left as is in transform=. With ellipses, no embedding happens. This embedding takes place in the transform method of the SPObject, so this is why ellipses have no such method at all.