Skip to content

Commit

Permalink
adopt window.DOMPointReadOnly
Browse files Browse the repository at this point in the history
closes #320
  • Loading branch information
Fil committed Jan 3, 2025
1 parent d8ea800 commit 3d1b92c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ export default function(event, node) {
event = sourceEvent(event);
if (node === undefined) node = event.currentTarget;
if (node) {
var svg = node.ownerSVGElement || node;
if (svg.createSVGPoint) {
var point = svg.createSVGPoint();
point.x = event.clientX, point.y = event.clientY;
point = point.matrixTransform(node.getScreenCTM().inverse());
if (window.DOMPointReadOnly) {
const point = new window.DOMPointReadOnly(event.clientX, event.clientY)
.matrixTransform(node.getScreenCTM().inverse());
return [point.x, point.y];
}
if (node.getBoundingClientRect) {
Expand Down

0 comments on commit 3d1b92c

Please sign in to comment.