xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Ávila <asan...@nextech.com.br>
Subject Re: Transforming GraphicsNode
Date Mon, 05 Jun 2006 13:56:06 GMT
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: <julo.chrobak@hiro.sk>
To: <batik-users@xmlgraphics.apache.org>
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: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message