That makes a lot more sense, thanks. Jon -----Original Message----- From: Thomas DeWeese [mailto:[EMAIL PROTECTED] Sent: 01 March 2005 13:08 To: Batik Users Subject: Re: building GVT from elements
Jonathan Gray wrote: > AffineTransform transform = > AffineTransform.getTranslateInstance(-(graphicsNode.getBounds().getX()), > -(graphicsNode.getBounds().getY())); [...] > Graphics2D graphics = image.createGraphics(); > I should probably get a copy of the original transform from the graphicsNode > and replace it once I'm done writing the image. I would apply this transform to the Graphics2D before calling paint. This way you don't have to muck with the transform on the GraphicsNode at all. > Should it be up to the user to set this translation transform for each > GraphicsNode? Couldn't this be set on the GraphicsNode by the bridge when > it's created or would that alter the whole tree? The GraphicsNode tries to mirror the SVG document as closely as possible, if your SVG document has a rectangle drawn at 100, 100 then the GraphicsNode will draw at 100,100 in the current user coordinate system. As I said above the 'best' thing to do is to translate the user->device transform for the Graphics2D before calling paint rather than mucking with the GraphicsNode transform. --------------------------------------------------------------------- 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]