Hi Oliver.

Oliver Brook:
> In my application I am translating, scaling and rotating elements  
> using a transform attribute on each element in the following way:
> 
> transform="translate(x,y) scale(s) rotate(r, cx, cy)"
> 
> In order to edit the transforms of each element in my document I am  
> accessing the element's SVGTransformList and then editing the  
> properties of the SVGTransforms in the list. This works great except  
> for rotation transforms. When I use SVGTransform.setRotate(rotation,  
> cx, cy) the canvas is updated as it should be and the element is  
> rotated by the correct amount around cx,cy. If, however, I then call  
> System.out.println(e.getAttribute("transform")) I can see the rotation  
> amount but the optional cx and cy components of the rotate transform  
> are missing from the DOM. This means that when save my document to a  
> file the resulting svg document has all of the rotate transforms  
> acting around the origin and, as a result, is a complete mess.
…
> I have thoroughly checked the rest of my program and am pretty certain  
> the problem is with my use of this method. Can anyone see an error I  
> am making here, or is this a Batik bug?

I tried calling setRotate() using script, and the DOM attribute seemed
to update for me:

  <svg xmlns='http://www.w3.org/2000/svg'>
    <g id='g' transform='translate(0,0) scale(1) rotate(1,2,3)'/>
    <script>
      var g = document.getElementById('g');
      var item = g.transform.baseVal.getItem(2);
      item.setRotate(4, 5, 6);
      alert(g.getAttribute('transform'));
    </script>
  </svg>

What version of Batik are you using?  Does the above document alert the
right attribute value?

-- 
Cameron McCormack, http://mcc.id.au/
        xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to