src/lib/touchhandler.js
function(evt) {
        evt.preventDefault();
        evt.stopPropagation();
        if (debug) { timedLog("secondFinger"); }
        if (evt.touches.length < 2) {
          return;
        }
        // we need to rebind finger 1, because it may have moved!
        transform.x1 = evt.touches[0].pageX;
        transform.y1 = evt.touches[0].pageY;
        transform.x2 = evt.touches[1].pageX;
        transform.y2 = evt.touches[1].pageY;

        var x1 = transform.x1,
          y1 = transform.y1,
          x2 = transform.x2,
          y2 = transform.y2,
          dx = x2 - x1,
          dy = y2 - y1,
          d = Math.sqrt(dx*dx + dy*dy),
          a = Math.atan2(dy,dx);

        transform.distance = d;
        transform.angle = a;
      }
function(evt) {
        evt.preventDefault();
        evt.stopPropagation();
        if (debug) { timedLog("secondFinger"); }
        if (evt.touches.length < 2) {
          return;
        }
        // we need to rebind finger 1, because it may have moved!
        transform.x1 = evt.touches[0].pageX;
        transform.y1 = evt.touches[0].pageY;
        transform.x2 = evt.touches[1].pageX;
        transform.y2 = evt.touches[1].pageY;

        var x1 = transform.x1,
          y1 = transform.y1,
          x2 = transform.x2,
          y2 = transform.y2,
          dx = x2 - x1,
          dy = y2 - y1,
          d = Math.sqrt(dx*dx + dy*dy),
          a = Math.atan2(dy,dx);

        transform.distance = d;
        transform.angle = a;
      }
function ( evt ) { evt . preventDefault ( ) ; evt . stopPropagation ( ) ; if ( debug ) { timedLog ( "secondFinger" ) ; } if ( evt . touches . length < 2 ) { return ; } // we need to rebind finger 1, because it may have moved! transform . x1 = evt . touches [ 0 ] . pageX ; transform . y1 = evt . touches [ 0 ] . pageY ; transform . x2 = evt . touches [ 1 ] . pageX ; transform . y2 = evt . touches [ 1 ] . pageY ; var x1 = transform . x1 , y1 = transform . y1 , x2 = transform . x2 , y2 = transform . y2 , dx = x2 - x1 , dy = y2 - y1 , d = Math . sqrt ( dx * dx + dy * dy ) , a = Math . atan2 ( dy , dx ) ; transform . distance = d ; transform . angle = a ; }
A second finger means we need to start tracking another
event coordinate, which may lead to rotation and scaling
updates for the element we're working for.
A second finger means we need to start tracking another event coordinate which may lead to rotation and scaling updates for the element we re working for .