Hi Julo, I think you could either translate the Point2D you pass to the contains() method using the same transform that you applied to the GraphicsNode or translate your node back to the original coordinate system using the inverse AffineTransform before calling contains(). Both solutions should work the same way.
Hope that helps, André ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[email protected]> Sent: Thursday, June 01, 2006 1:40 PM Subject: Transforming GraphicsNode > Hi, > > I have one problem. I am painting GraphicsNode instance into a JFrame > calling it's paint method. This drawing works great. > > Then I need to determine if a particular point is contained in > GraphicsNode instance (for example a mouse position after mouse click). So > I use the contain method of my GraphicsNode instance. And this is the > problem. First time I use contains method it works correctly. But then I > translate the GraphicsNode instance using > AffineTransform.getTranslateInstance(tx, ty) and node's setTransform > method. After the translation the node is painted into new position but > the contains method returns true only for the points in original position. > I don't understand why. > > Can any one help me? I need to transform the GraphicsNode instances in a > way that the contains method will return true for points in new positions. > > If my email is too complicated I can write down little example. > > Thanks a lot > Julo Chrobak > > > --------------------------------------------------------------------- > 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]
