public static NaviPoint getComponentPointRelativeToDomElement(Element element, NaviPoint p) { SVGMatrix mat = ((SVGLocatable) element).getScreenCTM(); return p.matrixTransform(mat); }
public static NaviPoint getLocalPointFromDomElement(Element element, float x, float y) { SVGMatrix mat = ((SVGLocatable) element).getScreenCTM(); SVGMatrix imat = mat.inverse(); // screen -> elem NaviPoint pt = new NaviPoint(x, y); return pt.matrixTransform(imat); }