@@ -3172,13 +3172,13 @@ function d3_svg_diagonalProjection(d) {
31723172 return [ d . x , d . y ] ;
31733173}
31743174d3 . svg . mouse = function ( container ) {
3175- return d3_svg_mousePoints ( container , [ d3 . event ] ) [ 0 ] ;
3175+ return d3_svg_mousePoint ( container , d3 . event ) ;
31763176} ;
31773177
31783178// https://bugs.webkit.org/show_bug.cgi?id=44083
31793179var d3_mouse_bug44083 = / W e b K i t / . test ( navigator . userAgent ) ? - 1 : 0 ;
31803180
3181- function d3_svg_mousePoints ( container , events ) {
3181+ function d3_svg_mousePoint ( container , e ) {
31823182 var point = ( container . ownerSVGElement || container ) . createSVGPoint ( ) ;
31833183 if ( ( d3_mouse_bug44083 < 0 ) && ( window . scrollX || window . scrollY ) ) {
31843184 var svg = d3 . select ( document . body )
@@ -3190,21 +3190,23 @@ function d3_svg_mousePoints(container, events) {
31903190 d3_mouse_bug44083 = ! ( ctm . f || ctm . e ) ;
31913191 svg . remove ( ) ;
31923192 }
3193- return events . map ( function ( e ) {
3194- if ( d3_mouse_bug44083 ) {
3195- point . x = e . pageX ;
3196- point . y = e . pageY ;
3197- } else {
3198- point . x = e . clientX ;
3199- point . y = e . clientY ;
3200- }
3201- point = point . matrixTransform ( container . getScreenCTM ( ) . inverse ( ) ) ;
3202- return [ point . x , point . y ] ;
3203- } ) ;
3193+ if ( d3_mouse_bug44083 ) {
3194+ point . x = e . pageX ;
3195+ point . y = e . pageY ;
3196+ } else {
3197+ point . x = e . clientX ;
3198+ point . y = e . clientY ;
3199+ }
3200+ point = point . matrixTransform ( container . getScreenCTM ( ) . inverse ( ) ) ;
3201+ return [ point . x , point . y ] ;
32043202} ;
32053203d3 . svg . touches = function ( container ) {
32063204 var touches = d3 . event . touches ;
3207- return touches ? d3_svg_mousePoints ( container , d3_array ( touches ) ) : [ ] ;
3205+ return touches ? d3_array ( touches ) . map ( function ( touch ) {
3206+ var point = d3_svg_mousePoint ( container , touch ) ;
3207+ point . identifier = touch . identifier ;
3208+ return point ;
3209+ } ) : [ ] ;
32083210} ;
32093211d3 . svg . symbol = function ( ) {
32103212 var type = d3_svg_symbolType ,
0 commit comments