docs/openjscad.js
function(e) {
    this.touch.cur = 'dragging';
    var delta = 0;
    if (this.touch.lastY && (e.gesture.direction == 'up' || e.gesture.direction == 'down')) {
      //tilt
      delta = e.gesture.deltaY - this.touch.lastY;
      this.angleX += delta;
    } else if (this.touch.lastX && (e.gesture.direction == 'left' || e.gesture.direction == 'right')) {
      //pan
      delta = e.gesture.deltaX - this.touch.lastX;
      this.angleZ += delta;
    }
    if (delta)
      this.onDraw();
    this.touch.lastX = e.gesture.deltaX;
    this.touch.lastY = e.gesture.deltaY;
  }
function(e) {
    this.touch.cur = 'dragging';
    var delta = 0;
    if (this.touch.lastY && (e.gesture.direction == 'up' || e.gesture.direction == 'down')) {
      //tilt
      delta = e.gesture.deltaY - this.touch.lastY;
      this.angleX += delta;
    } else if (this.touch.lastX && (e.gesture.direction == 'left' || e.gesture.direction == 'right')) {
      //pan
      delta = e.gesture.deltaX - this.touch.lastX;
      this.angleZ += delta;
    }
    if (delta)
      this.onDraw();
    this.touch.lastX = e.gesture.deltaX;
    this.touch.lastY = e.gesture.deltaY;
  }
function ( e ) { this . touch . cur = 'dragging' ; var delta = 0 ; if ( this . touch . lastY && ( e . gesture . direction == 'up' || e . gesture . direction == 'down' ) ) { //tilt delta = e . gesture . deltaY - this . touch . lastY ; this . angleX += delta ; } else if ( this . touch . lastX && ( e . gesture . direction == 'left' || e . gesture . direction == 'right' ) ) { //pan delta = e . gesture . deltaX - this . touch . lastX ; this . angleZ += delta ; } if ( delta ) this . onDraw ( ) ; this . touch . lastX = e . gesture . deltaX ; this . touch . lastY = e . gesture . deltaY ; }
pan & tilt with one finger
pan & tilt with one finger