Hi, On Tue, 2005-11-29 at 10:21 -0500, Bishop, Michael W. CONTR J9C880 wrote: > Well let me see if I can be clearer. Maybe I'm doing this wrong. In my > application, I have a glass pane attached to a JFrame (because you can't > attach a glass pane directly to a JSVGCanvas). When I'm drawing shapes > to the canvas, I draw the "ghosted line" or "outline" as the user drags > the mouse, then render the shape to the JSVGCanvas when the user > releases the mouse. Since the 0, 0 of the glass pane is the upper-left > corner of the application (JFrame), I have to translate by +x and +y > where +x is the x of the JSVGCanvas and +y is the y of the JSVGCanvas > plus the height of the JMenuBar. Now when I draw to the JSVGCanvas, the > glass pane drawing "lines up" with the JSVGCanvas. I've been doing > drawing operations like this for a couple months, but it's always felt > like a hack.
IMHO, JSVGCanvas canvas overlay is an alternative options to draw this kind of stuff. You could draw your "ghosted line" or "outline" in the overlay. See the zoom part of overlay in squigle you could press, hold, drag mouse to draw rectangle. And the good thing about overlay, that it is matched coord with JSVGCanvas, no more +x +y for JMenuBar and JToolbar. For Element Bounding Box, you could get by gvtNode.getBounds() // check the API syntax for param and return values or svgDomNode.getBBox() // check the API syntax for param and return values Best Regards Tonny Kohar -- Sketsa SVG Graphics Editor http://www.kiyut.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
