Bug 40336

Summary: getStringValue of AbstractSVGTransformList returns string with values in wrong precesion
Product: Batik - Now in Jira Reporter: Nick Van den Bleeken <Nick_Van_den_Bleeken>
Component: SVG DOMAssignee: Batik Developer's Mailing list <batik-dev>
Status: RESOLVED FIXED    
Severity: normal Keywords: PatchAvailable
Priority: P2    
Version: 1.6   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: Patch that solves the problem

Description Nick Van den Bleeken 2006-08-28 13:29:29 UTC
When you change the scale parameters and/or translate parameters you can only
specify a float. The data is stored in a double (AffineTransform). When the
doubles are appended to the StringBuffer they are appended using the append
method with a double. This results in extra 'noise' digits if the float couldn't
be represented exactly. 

E.g.: If you set scaleX and scaleY to '0.1', then the the result of
getStringValue will be 'scale(0.009999999776482582 0.009999999776482582)'

Note: The problem is already fixed when outputting the 'matrix' transform. The
double is casted to a float before it is given to the append method of the
StringBuffer
Comment 1 Nick Van den Bleeken 2006-08-28 13:32:18 UTC
Created attachment 18758 [details]
Patch that solves the problem
Comment 2 Nick Van den Bleeken 2006-08-28 13:33:44 UTC
Patch fixes the problem in the same way as the 'matrix' transform.
Comment 3 Cameron McCormack 2007-01-21 15:14:27 UTC
Fixed in SVN now.  Thanks for the patch!