protected void limitTransAndScale(Matrix matrix){
  float[] vals=new float[9];
  matrix.getValues(vals);
  float curTransX=vals[Matrix.MTRANS_X];
  float curScaleX=vals[Matrix.MSCALE_X];
  mScaleX=Math.max(1f,Math.min(getMaxScale(),curScaleX));
  float maxTransX=-(float)mContentRect.width() * (mScaleX - 1f);
  float newTransX=Math.min(Math.max(curTransX,maxTransX),0);
  vals[Matrix.MTRANS_X]=newTransX;
  vals[Matrix.MSCALE_X]=mScaleX;
  matrix.setValues(vals);
}

protected void limitTransAndScale ( Matrix matrix ) { float [ ] vals = new float [ 9 ] ; matrix . getValues ( vals ) ; float curTransX = vals [ Matrix . MTRANS_X ] ; float curScaleX = vals [ Matrix . MSCALE_X ] ; mScaleX = Math . max ( 1f , Math . min ( getMaxScale ( ) , curScaleX ) ) ; float maxTransX = - ( float ) mContentRect . width ( ) * ( mScaleX - 1f ) ; float newTransX = Math . min ( Math . max ( curTransX , maxTransX ) , 0 ) ; vals [ Matrix . MTRANS_X ] = newTransX ; vals [ Matrix . MSCALE_X ] = mScaleX ; matrix . setValues ( vals ) ; }
limits the maximum scale and x translation of the given matrix
