xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Translation problem for group element
Date Tue, 11 Apr 2006 13:09:23 GMT
Hi Selva,

news <news@sea.gmane.org> wrote on 04/11/2006 09:00:50 AM:

> I have created <g> element with 2 rectangles. I tried to move the group 
> element using translate. but it is not moving properly. Each time it is 
> to initial position, which had before moving the element. I have 
attached my 
> sample code for your reference.

   That is because your localPt function includes the transform you just
set.  You need to pass ee's parent because that is really the coordinate 
you are moving in (by adjusting the transform on the group).

> if (action == DRAG) {
> Element ee = (Element)((Element)actionNode).getParentNode();
>    SVGPoint pt = localPt(ee, elEvt.getClientX(), elEvt.getClientY());

   Change this line to:
      SVGPoint pt = localPt((Element)(ee.getParenNode()), 
                            elEvt.getClientX(), elEvt.getClientY());

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

View raw message