flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
20
BACK_BACK/node_modules/d3-selection/src/pointer.js
generated
vendored
Executable file
20
BACK_BACK/node_modules/d3-selection/src/pointer.js
generated
vendored
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
import sourceEvent from "./sourceEvent.js";
|
||||
|
||||
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());
|
||||
return [point.x, point.y];
|
||||
}
|
||||
if (node.getBoundingClientRect) {
|
||||
var rect = node.getBoundingClientRect();
|
||||
return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
|
||||
}
|
||||
}
|
||||
return [event.pageX, event.pageY];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue