[ 
https://issues.apache.org/jira/browse/BATIK-1326?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Bixby updated BATIK-1326:
--------------------------------
    Description: 
For a given SVG Element, initially transform = translate ({*}X{*}, {*}Y{*}). 
Querying the SVG matrix values shows that A-E are as expected (1.0, 0.0, 0.0, 
1.0, and {*}X{*}). The value for F, however does not match Y in the transform 
attribute.

Setting the transform attribute directly - via setAttribute() in UpdateManagers 
thread - does correctly affects the object on the screen. Later querying of the 
transform attribute also reflects what was set. However, queries of the SVG 
matrix show while the A-E values update to reflect what is in the transform 
attribute, F never appears to update. This applies whether the transform is set 
to “translate(x,y)” or “matrix(a,b,c,d,e,f)”.

Ideally the SVG Matrix could be referenced throughout the life of the code 
(versus string-parsing through the transform attribute); however F cannot 
currently be used to calculate y-displacements (since the initial value is off).

+*General pseudo-Snippet:*+

Element anElement = myDocument.getElementById(myName);

SVGLocatable locObj = (SVGLocatable) anElement;

SVGElement aParent = (SVGElement) findParent (anElem);

SVGMatrix aMatrix = locObj.getTransformToElement(aParent);

print(aMatrix.getA(), aMatrix.getB(), ... aMatrix.getF());

 

  was:
For a given SVG Element, initially transform = translate ({*}X{*}, {*}Y{*}). 
Querying the SVG matrix values shows that A-E are as expected (1.0, 0.0, 0.0, 
1.0, and {*}X{*}). The value for F, however does not match Y in the transform 
attribute.

Setting the transform attribute directly - via setAttribute() in UpdateManagers 
thread - does correctly affects the object on the screen. Later querying of the 
transform attribute also reflects what was set. However, queries of the SVG 
matrix show while the A-E values update to reflect what is in the transform 
attribute, F never appears to update. This applies whether the transform is set 
to “translate(x,y)” or “matrix(a,b,c,d,e,f)”.

Ideally the SVG Matrix could be referenced throughout the life of the code 
(versus string-parsing through the transform attribute); however F cannot 
currently be used to calculate y-displacements (since it never updates).

+*General pseudo-Snippet:*+

Element anElement = myDocument.getElementById(myName);

SVGLocatable locObj = (SVGLocatable) anElement;

SVGElement aParent = (SVGElement) findParent (anElem);

SVGMatrix aMatrix = locObj.getTransformToElement(aParent);

print(aMatrix.getA(), aMatrix.getB(), ... aMatrix.getF());

 


> SVGMatrix getF() doesn't reflect transform attribute
> ----------------------------------------------------
>
>                 Key: BATIK-1326
>                 URL: https://issues.apache.org/jira/browse/BATIK-1326
>             Project: Batik
>          Issue Type: Bug
>          Components: SVG DOM
>    Affects Versions: 1.14
>         Environment: RHEL 7.9
>            Reporter: Daniel Bixby
>            Priority: Major
>
> For a given SVG Element, initially transform = translate ({*}X{*}, {*}Y{*}). 
> Querying the SVG matrix values shows that A-E are as expected (1.0, 0.0, 0.0, 
> 1.0, and {*}X{*}). The value for F, however does not match Y in the transform 
> attribute.
> Setting the transform attribute directly - via setAttribute() in 
> UpdateManagers thread - does correctly affects the object on the screen. 
> Later querying of the transform attribute also reflects what was set. 
> However, queries of the SVG matrix show while the A-E values update to 
> reflect what is in the transform attribute, F never appears to update. This 
> applies whether the transform is set to “translate(x,y)” or 
> “matrix(a,b,c,d,e,f)”.
> Ideally the SVG Matrix could be referenced throughout the life of the code 
> (versus string-parsing through the transform attribute); however F cannot 
> currently be used to calculate y-displacements (since the initial value is 
> off).
> +*General pseudo-Snippet:*+
> Element anElement = myDocument.getElementById(myName);
> SVGLocatable locObj = (SVGLocatable) anElement;
> SVGElement aParent = (SVGElement) findParent (anElem);
> SVGMatrix aMatrix = locObj.getTransformToElement(aParent);
> print(aMatrix.getA(), aMatrix.getB(), ... aMatrix.getF());
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-h...@xmlgraphics.apache.org

Reply via email to