Files
ETB/ETB-FrontEnd/node_modules/@mui/x-charts/esm/internals/getSVGPoint.js
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

11 lines
332 B
JavaScript

/**
* Transform mouse event position to coordinates inside the SVG.
* @param svg The SVG element
* @param event The mouseEvent to transform
*/
export function getSVGPoint(svg, event) {
const pt = svg.createSVGPoint();
pt.x = event.clientX;
pt.y = event.clientY;
return pt.matrixTransform(svg.getScreenCTM().inverse());
}