private void performDragOrPinch(){
  if (selectedObject == null) {
    return;
  }
  float currScale=!mCurrentTouchPointPosAndScale.isUpdateScale() ? 1.0f : mCurrentTouchPointPosAndScale.getScale() == 0.0f ? 1.0f : mCurrentTouchPointPosAndScale.getScale();
  extractCurrentTouchPointInfo();
  float newPosX=mCurrentTouchPointX - startPosX * currScale;
  float newPosY=mCurrentTouchPointY - startPosY * currScale;
  float deltaX=mCurrentTouchPoint.getX() - mPrevTouchPoint.getX();
  float deltaY=mCurrentTouchPoint.getY() - mPrevTouchPoint.getY();
  float newScale;
  if (getMode() == MODE_ST_GRAB) {
    if (deltaX < 0.0f || deltaY < 0.0f) {
      newScale=mCurrentTouchPointPosAndScale.getScale() - 0.04f;
    }
 else {
      newScale=mCurrentTouchPointPosAndScale.getScale() + 0.04f;
    }
    if (newScale < 0.35f)     return;
  }
 else {
    newScale=startScaleOverPinchDiam * mCurrentTouchPointDiam;
  }
  if (!mDragOccurred) {
    if (!pastThreshold(Math.abs(deltaX),Math.abs(deltaY),newScale)) {
      return;
    }
  }
  float newScaleX=startScaleXOverPinchWidth * mCurrentTouchPointWidth;
  float newScaleY=startScaleYOverPinchHeight * mCurrentTouchPointHeight;
  float newAngle=startAngleMinusPinchAngle + mCurrentTouchPointAng;
  mCurrentTouchPointPosAndScale.set(newPosX,newPosY,newScale,newScaleX,newScaleY,newAngle);
  objectCanvas.setPositionAndScale(selectedObject,mCurrentTouchPointPosAndScale,mCurrentTouchPoint);
  mDragOccurred=true;
}

private void performDragOrPinch ( ) { if ( selectedObject == null ) { return ; } float currScale = ! mCurrentTouchPointPosAndScale . isUpdateScale ( ) ? 1.0f : mCurrentTouchPointPosAndScale . getScale ( ) == 0.0f ? 1.0f : mCurrentTouchPointPosAndScale . getScale ( ) ; extractCurrentTouchPointInfo ( ) ; float newPosX = mCurrentTouchPointX - startPosX * currScale ; float newPosY = mCurrentTouchPointY - startPosY * currScale ; float deltaX = mCurrentTouchPoint . getX ( ) - mPrevTouchPoint . getX ( ) ; float deltaY = mCurrentTouchPoint . getY ( ) - mPrevTouchPoint . getY ( ) ; float newScale ; if ( getMode ( ) == MODE_ST_GRAB ) { if ( deltaX < 0.0f || deltaY < 0.0f ) { newScale = mCurrentTouchPointPosAndScale . getScale ( ) - 0.04f ; } else { newScale = mCurrentTouchPointPosAndScale . getScale ( ) + 0.04f ; } if ( newScale < 0.35f ) return ; } else { newScale = startScaleOverPinchDiam * mCurrentTouchPointDiam ; } if ( ! mDragOccurred ) { if ( ! pastThreshold ( Math . abs ( deltaX ) , Math . abs ( deltaY ) , newScale ) ) { return ; } } float newScaleX = startScaleXOverPinchWidth * mCurrentTouchPointWidth ; float newScaleY = startScaleYOverPinchHeight * mCurrentTouchPointHeight ; float newAngle = startAngleMinusPinchAngle + mCurrentTouchPointAng ; mCurrentTouchPointPosAndScale . set ( newPosX , newPosY , newScale , newScaleX , newScaleY , newAngle ) ; objectCanvas . setPositionAndScale ( selectedObject , mCurrentTouchPointPosAndScale , mCurrentTouchPoint ) ; mDragOccurred = true ; }
drag / stretch / rotate the selected object using the current touch position ( s ) relative to the anchor position ( s ) .
