Hi,
I
just updated from 1.5 to 1.5.1 but discovered a problem. In our SVG we've got
some elements using symbols from a template SVG via the use-tag. If I
change an attribute of such a 'use'ed element the change is not drawn. Only
after changing the xlink:href attribute the previously changed style or position
take effect. In the previous version of batik that was working with no
problems.
In the template file
there somewhere a definition like:
<defs>
...
<symbol id="SwitchLeft">
<line x1="0" y1="25" x2="37.5" y2="25"
style="fill:none;stroke-width:3"/>
<line x1="0" y1="0" x2="12.5" y2="12.5"
style="fill:none;stroke-width:3"/>
</symbol>
...
<symbol id="SwitchLeft">
<line x1="0" y1="25" x2="37.5" y2="25"
style="fill:none;stroke-width:3"/>
<line x1="0" y1="0" x2="12.5" y2="12.5"
style="fill:none;stroke-width:3"/>
</symbol>
...
</defs>
The main SVG then
'use'es that element:
...
<g
id="W101">
<rect x="112.5" y="705" width="40" height="40"
style="fill-opacity:0;fill:rgb(192,192,192)"/>
<polyline id="Select003" points="112.5,705 152.5,705 152.5,745 112.5,745"
style="fill:none"/>
<use x="112.5" y="700" xlink:href=""
style="stroke:rgb(255,0,0)" transform="matrix(-1 0 0 1 261.439 0)"/>
<circle id="Error003" cx="132.5" cy="725" r="20"
style="stroke:rgb(0,0,255);stroke-width:5;fill:none"/>
</g>
...
<rect x="112.5" y="705" width="40" height="40"
style="fill-opacity:0;fill:rgb(192,192,192)"/>
<polyline id="Select003" points="112.5,705 152.5,705 152.5,745 112.5,745"
style="fill:none"/>
<use x="112.5" y="700" xlink:href=""
style="stroke:rgb(255,0,0)" transform="matrix(-1 0 0 1 261.439 0)"/>
<circle id="Error003" cx="132.5" cy="725" r="20"
style="stroke:rgb(0,0,255);stroke-width:5;fill:none"/>
</g>
...
If now the code
changes the style attribute of the use-tag nothing happens.
Regards
Wolfgang
Reh
PS: All changes to
the DOM-tree are made via calls to like
Canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new
SetElementAttribute(UseElement, MyConstants.StyleAttribute,
Style));
