Skip to content

Instantly share code, notes, and snippets.

@netsi1964
Last active April 18, 2022 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netsi1964/b5957f31a56cff9f97ed7ba3c67ae799 to your computer and use it in GitHub Desktop.
Save netsi1964/b5957f31a56cff9f97ed7ba3c67ae799 to your computer and use it in GitHub Desktop.
Some SVG utils
export screen2svg = (eleSvg, x, y) => {
const point = eleSvg.createSVGPoint();
point.x = x;
point.y = y;
return point.matrixTransform(eleSvg.getScreenCTM().inverse());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment