You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Henric Rosvall <he...@opv.se> on 2006/10/31 09:58:20 UTC

Latest SVN and Transformations

Hi !
 
I'm currently experimenting with FlowRoot-elements, and since the
official 1.6-release of Batik cdidn't seem to be able to handle removing
and inserting new flowPara-Element, I downloaded and compiled the latest
SVN. But after changing Batik-version neither flowPara-editing nor
Matrix-transformations work. The flowpara I can understand, but why
would matrix-transformations suddenly stop working? I can change text in
a normal Text-object, change color, font, style. But when I try to apply
a transformation to an object using the code listed below, the
transform-attribute of the Element changes, but the rendered object is
unaffected. The same obvously goes for skewing, rotating and scaling
aswell.
 
The SvgElementEnh has stored an SVGOMMatrix with the current
transformation, and any change to the transform is first applied to that
matrix, and is then outputted as a String-attribute in the Element
 
 public static synchronized void move(SvgElementEnh e, float moveX,
float moveY)
 {
 
        float newX = e.transform.getE() + moveX;
        float newY = e.transform.getF() + moveY;
  
        e.transform.setE(newX);
        e.transform.setF(newY);
        
        e.getElement().setAttribute("transform", "matrix("+
String.valueOf(e.transform.getA()) +" "+
String.valueOf(e.transform.getB()) +" "+
String.valueOf(e.transform.getC()) +" "+
String.valueOf(e.transform.getD()) +" "+
String.valueOf(e.transform.getE()) +" "+
String.valueOf(e.transform.getF()) +")"); 
 }
 
 
What am I doing wrong?
 
Regards
Henric Rosvall

Re: Latest SVN and Transformations

Posted by th...@kodak.com.
Hi Henric,

"Henric Rosvall" <he...@opv.se> wrote on 10/31/2006 03:58:20 AM:

> The SvgElementEnh has stored an SVGOMMatrix with the current 
transformation, 
> and any change to the transform is first applied to that matrix, and is 
then 
> outputted as a String-attribute in the Element

   We believe there is a bug in the AnimatedTransform support that was
added for SMIL animation.  This is causing the engine to not notice 
changes
to the transform attribute for some reason.  However, neither Cameron or I 
has had
the time to track down the bug yet....

> 
>  public static synchronized void move(SvgElementEnh e, float moveX, 
float moveY)
>  {
> 
>         float newX = e.transform.getE() + moveX;
>         float newY = e.transform.getF() + moveY;
> 
>         e.transform.setE(newX);
>         e.transform.setF(newY);
> 
>         e.getElement().setAttribute("transform", "matrix("+ 
String.valueOf(e.
> transform.getA()) +" "+ String.valueOf(e.transform.getB()) +" "+ String.
> valueOf(e.transform.getC()) +" "+ String.valueOf(e.transform.getD()) +" 
"+ 
> String.valueOf(e.transform.getE()) +" "+ 
String.valueOf(e.transform.getF()) +")"); 
>  }
> 
> 
> What am I doing wrong?
> 
> Regards
> Henric Rosvall

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