Hi Selva, news <[EMAIL PROTECTED]> wrote on 07/22/2006 06:02:01 AM:
> > GraphicsNode gn = getUpdateManager().getBridgeContext().getGraphicsNode > > (element); > > Rectangle2D gnb = getViewingTransform().createTransformedShape(gn.getBounds > > ()).getBounds(); > > if i use getViewingTransform, it doesn't return the correct value of width and > height. but it returns correct value of x and y. What do you base this assertion on? What did you get for x & y and what were you expecting? > if i use getViewBoxTransform, it doesn't return the correct value of x and y. > but it returns correct value of width and height. Again, what do you base this assertion on? What did you get for width & height and what were you expecting? > So i used the following code. Is it correct way or is there any other way to > find both values using single transform? Assuming you want the x/y/w/h in screen coords I would use SVGLocatable.getScreenCTM to map the getBBox of the Element to the screen. > GraphicsNode gn = getUpdateManager().getBridgeContext().getGraphicsNode > (imgRect); > Rectangle2D gnb = getViewingTransform().createTransformedShape(gn.getBounds > ()).getBounds(); > Rectangle2D gnb1 = getViewBoxTransform().createTransformedShape(gn.getBounds > ()).getBounds(); > Rectangle2D rect2D = new Rectangle2D.Float((int)gnb.getX(), (int)gnb.getY(), > (int)gnb1.getWidth(), (int)gnb1.getHeight()); I can't believe this is really correct in any real way (it is likely just happening to work in your current circumstances). --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
