MCPcopy Create free account
hub / github.com/breck7/scroll / pointer

Function pointer

external/.d3.js:2599–2616  ·  view source on GitHub ↗
(event, node)

Source from the content-addressed store, hash-verified

2597}
2598
2599function pointer(event, node) {
2600 event = sourceEvent(event);
2601 if (node === undefined) node = event.currentTarget;
2602 if (node) {
2603 var svg = node.ownerSVGElement || node;
2604 if (svg.createSVGPoint) {
2605 var point = svg.createSVGPoint();
2606 point.x = event.clientX, point.y = event.clientY;
2607 point = point.matrixTransform(node.getScreenCTM().inverse());
2608 return [point.x, point.y];
2609 }
2610 if (node.getBoundingClientRect) {
2611 var rect = node.getBoundingClientRect();
2612 return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
2613 }
2614 }
2615 return [event.pageX, event.pageY];
2616}
2617
2618function pointers(events, node) {
2619 if (events.target) { // i.e., instanceof Event, not TouchList or iterable

Callers 11

pointersFunction · 0.85
beforestartFunction · 0.85
startedFunction · 0.85
movedFunction · 0.85
wheeledFunction · 0.85
mousedownedFunction · 0.85
mousemovedFunction · 0.85
dblclickedFunction · 0.85
touchstartedFunction · 0.85
touchmovedFunction · 0.85
touchendedFunction · 0.85

Calls 1

sourceEventFunction · 0.85

Tested by

no test coverage detected