On 3/17/06, MenTaLguY <mental@...3...> wrote:
If the clipPath and the clipped objects share a parent group, then you get "compensation" for free.
Not entirely for free, and in any case no more free than when they are elsewhere. Here's the scoop: The spec says that any transform= on clipped object affects the clippath as well, and we implement this. Therefore, for objects that always get transform= such as groups or ellipses, you get transforming the clippath truly for free, and this does not depend on where is the clippath - in defs or in group. It works the same both ways. However for objects that completely or partially embed the transformation, we will need to either (a) disable that and write transform= if there's a clippath or mask, or (b) add transform= to the clippath/mask corresponding to the embedded portion of the transform. Both approaches are relatively easy to do. Your approach (always putting clippend object(s) in group with clippath there too) is just another way of doing the (a) - you just disable embedding transforms into the object by virtue of its always being the group. However for that you have to pay the price of an unavoidable extra level of <g> and the dangers associated with resources-not-in-defs which our legacy code is known to mishandle often.
Unlike gradients, I don't see a strong case for re-using clipPaths either (another usual motivation for putting things in <defs>).
Sure, I don't want them to be shared either. It's not about sharing or not sharing.
Keeping the clipPath with the clipped objects seems to be the simplest approach...
I don't think so, see above. Besides, if you rely on your clippaths always inside groups and thus do not implement (a) or (b) above, you will damage your ability to gracefully handle non-Inkscape SVGs.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org