File tree Expand file tree Collapse file tree 3 files changed +39
-7
lines changed Expand file tree Collapse file tree 3 files changed +39
-7
lines changed Original file line number Diff line number Diff line change 1089
1089
d3 . mouse = function ( container ) {
1090
1090
return d3_mousePoint ( container , d3_eventSource ( ) ) ;
1091
1091
} ;
1092
+ var d3_mouse_bug44083 = / W e b K i t / . test ( d3_window . navigator . userAgent ) ? - 1 : 0 ;
1092
1093
function d3_mousePoint ( container , e ) {
1093
1094
if ( e . changedTouches ) e = e . changedTouches [ 0 ] ;
1094
1095
var svg = container . ownerSVGElement || container ;
1095
1096
if ( svg . createSVGPoint ) {
1096
1097
var point = svg . createSVGPoint ( ) ;
1097
- point . x = e . clientX , point . y = e . clientY ;
1098
+ if ( d3_mouse_bug44083 < 0 && ( d3_window . scrollX || d3_window . scrollY ) ) {
1099
+ svg = d3 . select ( "body" ) . append ( "svg" ) . style ( {
1100
+ position : "absolute" ,
1101
+ top : 0 ,
1102
+ left : 0 ,
1103
+ margin : 0 ,
1104
+ padding : 0 ,
1105
+ border : "none"
1106
+ } , "important" ) ;
1107
+ var ctm = svg [ 0 ] [ 0 ] . getScreenCTM ( ) ;
1108
+ d3_mouse_bug44083 = ! ( ctm . f || ctm . e ) ;
1109
+ svg . remove ( ) ;
1110
+ }
1111
+ if ( d3_mouse_bug44083 ) point . x = e . pageX , point . y = e . pageY ; else point . x = e . clientX ,
1112
+ point . y = e . clientY ;
1098
1113
point = point . matrixTransform ( container . getScreenCTM ( ) . inverse ( ) ) ;
1099
1114
return [ point . x , point . y ] ;
1100
1115
}
You can’t perform that action at this time.
0 commit comments