When you click on the item, it gives you the coordinates as if the object was not translated, i imagine to keep the hotspot active, regardless of the transformation.
I need to get the actual translated (rotated) coordinates of the click location (in reference to the full canvas) as well, since i am doing some graphics 2D on top of my SVG. Is there a way to get these coordinates, or shall i perform my own formulas?
Andres.
I am retrieving my coordinates by:
public class OnMoveAction implements EventListener {
public void handleEvent(Event evt) {
//Cast the event onto a Batik Mouse event, co we can get ccordinates
DOMMouseEvent elEvt = (DOMMouseEvent)evt;
int nowToX = elEvt.getClientX();
int nowToY = elEvt.getClientY();
//convert it to a point for use with the Matrix
SVGOMPoint pt = new SVGOMPoint(nowToX, nowToY);
//Get the item¥s screen coordinates, and apply the transformation
SVGMatrix mat = ((SVGLocatable)evt.getTarget()).getScreenCTM(); // elem -> screen
mat = mat.inverse(); // screen -> elem
dragpt = (SVGOMPoint)pt.matrixTransform(mat);
...
}
}
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]