Difficulties with understanding the SVG spec's description of the "vector-effect" attribute

55 views Asked by At

I'm having some trouble understanding the information that's being conveyed in the SVG specification's description of vector effects. Specifically, the text describing the "viewport" and "screen" specifiers seem to contradict the examples given.

My understanding is that if "viewport" (which is supposed to be the default) is specified, then the vector effect only applies to the transforms within the parent viewport (which I understand to be any element which has the "viewBox" attribute). If the screen attribute is specified, then the vector effect is applied to the composite transform of all parents of the element which has the effect.

All of that makes sense, but the example images seem to contradict it, and each other. The example file (the second block of text in section 8.13.3) is comprised of a top-level SVG fragment (viewport), which contains a group with a transform, which contains another SVG fragment (viewport). This contains a grid and arrow (path element with its own transform). Both SVG fragments are understood to have an implicit transform defined by their height, width, and viewBox.

So, based on this I would expect that any "viewport" (default) vector effect would only apply to the implicit transform from the inner SVG fragment and any transforms within that (such as the transform in the path element). So, for instance, I would expect the "non-rotation" example to have no effect since the rotation transform is outside of the inner viewport. This applies to most of the examples given, it seems like the "screen" specifier is being treated as the default.

BUT, in the fixed-position example, the vector effect seems to apply to the transform specified outside of the inner viewport and not the transform specified within the path element itself, which accounts for most of the translation that's seen in the example.

With all of this, on top of a few different interpretations of this I've seen in implementations, I'm having trouble figuring out what is technically correct here, or if I'm missing something altogether. Any further information would be helpful.

0

There are 0 answers