OK, time to resurrect an old topic. Right now I'm only using the translate portion of a transform. I really don't care how the rest is handled. It really depends on the SVG document. Here's the scenario.
- Load any SVG document. - Drag an element around the JSVGCanvas by updating its transform however it's represented. I guess it doesn't matter really if the representation of the transform changes as long as it acts the same for the rest of the attribute. If I change the "translate" portion, I want to keep shear, scale, skew, rotate, etc. intact. Michael Bishop -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 9:23 PM To: [email protected] Cc: [email protected] Subject: Re: Conversion for AffineTransform? Hi Michael, "Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> wrote on 10/26/2005 02:47:33 PM: > I?m looking for something similar to SVGColor.toSVG() or SVGShape.toSVG(). I > see there?s an SVGOMMatrix that takes an AffineTransform as a constructor > argument, but I don?t see a way to create the ?transform=???? from it. It's trivial to construct if you are willing to use the 'matrix()' form. You can also have a 'translate(tx, ty) matrix(sx, shy, shx, sy, 0, 0)' so the transform is pulled out (sx = scaleX, shx = shearX, etc). If you don't want to use matrix then it depends on you knowing the form of your affine. > Does one exist? Similarly, is there one to go from a ?transform=???? back to some > object? I?m doing it with string parsing and it?s kinda ugly. You can use the parser classes from Batik: batik.parser.TransformListParser batik.parser.AWTTransformProducer --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
