File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
packages/pstricks/src/lib Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1471,7 +1471,9 @@ const psgraph = {
14711471 } ) ;
14721472 svg . on ( 'touchmove' , function ( event ) {
14731473 event . preventDefault ( ) ;
1474- var touchcoords = event . touches ? event . touches [ 0 ] : [ 0 , 0 ] ;
1474+ var touch = event . touches ? event . touches [ 0 ] : null ;
1475+ var rect = event . target . getBoundingClientRect ( ) ;
1476+ var touchcoords = touch ? [ touch . clientX - rect . left , touch . clientY - rect . top ] : [ 0 , 0 ] ;
14751477 userEvent ( touchcoords ) ;
14761478 } ) ;
14771479 svg . on ( 'mousemove' , function ( event ) {
Original file line number Diff line number Diff line change @@ -605,7 +605,9 @@ const psgraph: any = {
605605 'touchmove' ,
606606 function ( this : any , event : any ) {
607607 event . preventDefault ( ) ;
608- var touchcoords = event . touches ? event . touches [ 0 ] : [ 0 , 0 ] ;
608+ var touch = event . touches ? event . touches [ 0 ] : null ;
609+ var rect = event . target . getBoundingClientRect ( ) ;
610+ var touchcoords = touch ? [ touch . clientX - rect . left , touch . clientY - rect . top ] : [ 0 , 0 ] ;
609611 userEvent ( touchcoords ) ;
610612 }
611613 ) ;
You can’t perform that action at this time.
0 commit comments