Bug 40336 - getStringValue of AbstractSVGTransformList returns string with values in wrong precesion
Summary: getStringValue of AbstractSVGTransformList returns string with values in wron...
Status: RESOLVED FIXED
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: SVG DOM (show other bugs)
Version: 1.6
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2006-08-28 13:29 UTC by Nick Van den Bleeken
Modified: 2007-01-21 15:14 UTC (History)
0 users



Attachments
Patch that solves the problem (1.74 KB, patch)
2006-08-28 13:32 UTC, Nick Van den Bleeken
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!