We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I wonder if it’s worth caching getScreenCTM (and getBoundingClientRect) on start, since they shouldn’t change during a drag gesture?
function pointSvg(node, point) { var matrix = node.getScreenCTM().inverse(); return function(event) { point.x = event.clientX, point.y = event.clientY; point = point.matrixTransform(matrix); return [point.x, point.y]; }; } function pointHtml(node) { var rect = node.getBoundingClientRect(), left = rect.left + node.clientLeft, top = rect.top + node.clientTop; return function(event) { return [event.clientX - left, event.clientY - top]; }; } export default function(node) { var svg = node.ownerSVGElement || node; return svg.createSVGPoint ? pointSvg(node, svg.createSVGPoint()) : pointHtml(node); }
Related d3/d3#1797.
The text was updated successfully, but these errors were encountered:
Not going to pursue this for now.
Sorry, something went wrong.
No branches or pull requests
I wonder if it’s worth caching getScreenCTM (and getBoundingClientRect) on start, since they shouldn’t change during a drag gesture?
Related d3/d3#1797.
The text was updated successfully, but these errors were encountered: