xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Hardy <vincent.ha...@sun.com>
Subject Re: Problems changing the transform attribute.
Date Thu, 20 Jun 2002 16:22:00 GMT
Martin,

I have entered a bug in Bugzilla with a modified version of your example
that shows that if we remove the scaled node, modify its attribute and
then insert it again (which should have the exact same result), we get
the behavior you expect. 

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10066

Thanks for reporting this,
Vincent.

"Barbisch, Martin" wrote:
> 
> Hello there!
> 
> I wrote the following SVG file and displayed it with Batik and Adobe's SVG
> Viewer.
> When the transform attribute of <use> is changed (onclick()) Batik
> translates the upper left corner of the referenced <symbol> to the window
> origin. ASV does not. Which is the correct behavior? Simply changing the
> transform attribute of a <rect> works as expected.
> 
> Thanks,
> Martin
> 
> ProblemTransform.svg:
> 
> <?xml version="1.0"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
>   "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
> 
> <svg width="350" height="200">
> 
>   <script type="text/ecmascript"> <![CDATA[
> 
>     function scale(evt) {
> 
>         var box = evt.getCurrentTarget();
>         var tf  = box.getAttribute("transform");
> 
>         if (tf == "scale(1.0)") box.setAttribute("transform", "scale(1.2)");
>         else                    box.setAttribute("transform", "scale(1.0)");
>     }
> 
>   ]]> </script>
> 
>   <defs>
>     <symbol id="Rect" preserveAspectRatio="none" viewBox="0 0 100 100">
>       <rect x="0" y="0" width="100" height="100"
>             style="stroke:yellow; fill:red" />
>     </symbol>
>   </defs>
> 
>   <use xlink:href="#Rect" x="20" y="40" width="100" height="80"
>        transform="scale(1.0)" onclick="scale(evt)" />
> 
>   <rect x="150" y="40" width="100" height="80" transform="scale(1.0)"
>         style="fill:green; stroke:yellow" onclick="scale(evt)" />
> 
>   <text x="175" y="190" style="font-size:20pt; text-anchor:middle">
>     Transform problem.
>   </text>
> 
> </svg>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message