File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -501,6 +501,13 @@ function handlePointerUp(e, layerdict) {
501501 e . preventDefault ( ) ;
502502 e . stopPropagation ( ) ;
503503
504+ if ( e . button == 2 ) {
505+ // Reset pan and zoom on right click.
506+ resetTransform ( layerdict ) ;
507+ layerdict . anotherPointerTapped = false ;
508+ return ;
509+ }
510+
504511 // We haven't necessarily had a pointermove event since the interaction started, so make sure we update this now
505512 var ptr = layerdict . pointerStates [ e . pointerId ] ;
506513 ptr . distanceTravelled += Math . abs ( e . offsetX - ptr . lastX ) + Math . abs ( e . offsetY - ptr . lastY ) ;
@@ -519,10 +526,6 @@ function handlePointerUp(e, layerdict) {
519526 // This is the first finger coming off of what could become a two-finger tap
520527 layerdict . anotherPointerTapped = true ;
521528 }
522- } else if ( e . button == 2 ) {
523- // Reset pan and zoom on right click.
524- resetTransform ( layerdict ) ;
525- layerdict . anotherPointerTapped = false ;
526529 } else {
527530 if ( ! redrawOnDrag ) {
528531 redrawCanvas ( layerdict ) ;
You can’t perform that action at this time.
0 commit comments