Commit 5f8056c1 authored by Jason Davies's avatar Jason Davies
Browse files

Fix d3.mouse touch fallback for HTML targets.

parent a83ff054
......@@ -1072,6 +1072,7 @@ d3 = function() {
};
var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0;
function d3_mousePoint(container, e) {
if (e.changedTouches) e = e.changedTouches[0];
var svg = container.ownerSVGElement || container;
if (svg.createSVGPoint) {
var point = svg.createSVGPoint();
......@@ -1088,7 +1089,6 @@ d3 = function() {
d3_mouse_bug44083 = !(ctm.f || ctm.e);
svg.remove();
}
if (e.changedTouches) e = e.changedTouches[0];
if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX,
point.y = e.clientY;
point = point.matrixTransform(container.getScreenCTM().inverse());
......
This diff is collapsed.
......@@ -8,6 +8,7 @@ d3.mouse = function(container) {
var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0;
function d3_mousePoint(container, e) {
if (e.changedTouches) e = e.changedTouches[0];
var svg = container.ownerSVGElement || container;
if (svg.createSVGPoint) {
var point = svg.createSVGPoint();
......@@ -24,7 +25,6 @@ function d3_mousePoint(container, e) {
d3_mouse_bug44083 = !(ctm.f || ctm.e);
svg.remove();
}
if (e.changedTouches) e = e.changedTouches[0];
if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY;
else point.x = e.clientX, point.y = e.clientY;
point = point.matrixTransform(container.getScreenCTM().inverse());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment