Hi All,
I am trying to find the ZoomedIn/ZoomedOut element’s ‘x’ and ‘y’ attributes
values. But I couldn’t get the exact position. It returns the normal
position without zoomin/zoomout. I am using the following way to get the ‘x’
and ‘y’ attributes.
.
.
.
DOMMouseEvent elEvt = (DOMMouseEvent)event;
String cName = “BG_Rectangle”;
Element cElement = canvas.getSVGDocument().getElementById(cName);
SVGPoint cRect = localPt(cElement, (int)elEvt.getClientX(),
(int)elEvt.getClientY());
.
.
.
private SVGPoint localPt(Element elem, int x, int y) {
SVGMatrix mat = ((SVGLocatable)elem).getScreenCTM();
SVGMatrix imat = mat.inverse();
SVGPoint cPt =
_svgGraphView.getSVGDocument().getRootElement().createSVGPoint();
cPt.setX(x);
cPt.setY(y);
cPt = cPt.matrixTransform(imat);
return cPt;
}
Please let me know, if there is any problem in my code to get the attributes
values after ZoomIn/ZoomedOut?
Thanks,
Selva
--
View this message in context:
http://www.nabble.com/Finding-ZoomedIn-ZoomedOut-element%E2%80%99s-%E2%80%98x%E2%80%99-and-%E2%80%98y%E2%80%99-attribute-tf3509394.html#a9802422
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]