Comment 13 for bug 453067

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

A clone needs its own SPItems because the <use> element can have different styling which cascades down into the clone's elements. However, a gradient should not need to be forked. It is either inside the cloned object, and thus the same for all clones or it is defined outside and cascades down.

Gradient inside cloned object:

<rect id="myClonedRect" fill="url(#myGradient)" ... />
<use xlink:href="#myClonedRect" ... />
<use xlink:href="#myClonedRect" ... />

Gradient outside cloned object:

<rect id="myClonedRect" .../> <-- No fill
<use xlink:href="#myClonedRect2" fill="url(#myGradient1)" ... /> <-- Different gradients
<use xlink:href="#myClonedRect2" fill="url(#myGradient2)" ... />

If a gradient is defined relative to the bounding box its transform should be handled in the rendering code (like masks and clips).