You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by ma zhenduo <ma...@yahoo.com> on 2002/03/13 02:40:20 UTC

The bug about "nodeHitAt" and "transform" had not been gotten rid of.

I find there are a bug with batik-1.1.1(18-Dec-2001 ) and batik-1.5beta.
GraphicsNode#nodeHitAt can't find these node that has a "transform"
attribute.

Exp.  <path id="kinki"
style="fill:rgb(138,192,138);stroke:none;fill-rule:evenodd;clip-rule:evenodd
"
   d="M248.944 315.572 L250.24 309.285 C252.017 304.596 253.976 298.34
256.317 299.862
   C256.262 299.762 252.633 289.809 252.629 289.69
   L247.154 292.932 C245.687 294.255 243.834 295.249 242.729 296.701
   C242.389 295.06 238.76 295.896 233.5 289.9
   C234.834 289.234 235.379 288.265 235.136 286.992
   C234.077 287.394 231.053 288.088 229.228 288.81
   C229.486 289.955 229.87 290.992 230.336 291.96
   C227.55 289.98 221.092 290.233 217.697 290.637
   C226.334 294.106 219.53 303.923 218.815 307.508
   C233.807 311.108 238.438 305.462 236.443 299.685
   C237.185 300.451 238.487 301.039 239.202 301.851
   C238.956 301.714 238.451 302.641 238.176 302.502
   C239.106 308.822 236.435 313.873 231.682 317.809
   C233.257 317.385 234.914 317.049 236.564 316.682
   C224.407 322.338 239.381 339.838 245.661 328.578
   C246.542 327.254 248.944 315.572 248.944 315.572 z"
   transform="matrix(1 0 0 1 -43.1625 -83.3317)" cmap4uiecc:name="sun1"/>


Re: The bug about "nodeHitAt" and "transform" had not been gotten rid of.

Posted by ma zhenduo <ma...@yahoo.com>.
Thank you very much.
You are right.
Now I f  I "nodeHitAt" from root, I will find right node.
If  I "nodeHitAt" from that translated node, I can not find it.
Would you tell me how to apply the transform to your point before calling
nodeHitAt?

----- Original Message -----
From: "Thomas E Deweese" <th...@kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, March 13, 2002 8:05 PM
Subject: The bug about "nodeHitAt" and "transform" had not been gotten rid
of.


> >>>>> "mz" == ma zhenduo <ma...@yahoo.com> writes:
>
> mw> I find there are a bug with batik-1.1.1(18-Dec-2001 ) and
> mw> batik-1.5beta.  GraphicsNode#nodeHitAt can't find these node that
> mw> has a "transform" attribute.
>
>     You don't give much information on the context in which you think
> this bug exists.  So I know that onclick and what not work for SVG
> elements that are transformed (which become GraphicsNodes with a
> transform).
>
>     I suspect that the problem is you are passing coordinates in the
> root GraphicsNode's coordinate space as opposed to the GraphicsNode's
> local coordinate system.  Put in other words it is your responsability
> to apply the transform to your point before calling nodeHitAt.  You
> may not like this but it is generally significantly more effiecent
> than transforming the point from the root for each node if you are
> walking the whole gvt tree.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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


The bug about "nodeHitAt" and "transform" had not been gotten rid of.

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "mz" == ma zhenduo <ma...@yahoo.com> writes:

mw> I find there are a bug with batik-1.1.1(18-Dec-2001 ) and
mw> batik-1.5beta.  GraphicsNode#nodeHitAt can't find these node that
mw> has a "transform" attribute.

    You don't give much information on the context in which you think
this bug exists.  So I know that onclick and what not work for SVG
elements that are transformed (which become GraphicsNodes with a
transform).  

    I suspect that the problem is you are passing coordinates in the
root GraphicsNode's coordinate space as opposed to the GraphicsNode's
local coordinate system.  Put in other words it is your responsability
to apply the transform to your point before calling nodeHitAt.  You
may not like this but it is generally significantly more effiecent
than transforming the point from the root for each node if you are
walking the whole gvt tree.

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