/** 获取svg坐标点,兼容缩放和平移后的情况 */
// $event 方法原生参数
// svgEle svg元素Id
export const getSvgPoint = ($event: any, svgEle: string) => {
const svg: any = document.getElementById(svgEle);
let svgPoint = svg.createSVGPoint();
const { clientX, clientY } = $event;
svgPoint.x = clientX;
svgPoint.y = clientY;
const matrix = svg.getScreenCTM().inverse();
const { x, y } = svgPoint.matrixTransform(matrix);
return { x: Math.floor(x), y: Math.floor(y) }
};