Ron King wrote:

I'm modifying the Batik Squiggle program into a drawing tool. I can draw a bounding box (rectangle) on the screen around an element using getbbox() , but if I zoom and do getbbox() again, the box isn't in the right place.

That is because the rendering transform changes. I think you want to use getScreenCTM not just getTransformToElement(parent). Also you should be aware that the transform can change more than just the location. If you use the Java2D AffineTransform class it has a createTransformedShape method that will convert the rectangle to a polygon as needed.

I have the following code that is executed by mouse click:
[...] g.drawRect(newX, newY, width, height);

I don't know if this is just 'test' code but this is sort of solution may be problematic as there is nothing to repaint the rectangle as updates occur.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to