public void resizeInner(RectF newInner){
  Matrix m=getRotMatrix();
  Matrix m0=getInverseRotMatrix();
  float[] outerCorners=CropMath.getCornersFromRect(outer);
  m.mapPoints(outerCorners);
  float[] oldInnerCorners=CropMath.getCornersFromRect(inner);
  float[] newInnerCorners=CropMath.getCornersFromRect(newInner);
  RectF ret=new RectF(newInner);
  for (int i=0; i < newInnerCorners.length; i+=2) {
    float[] c={newInnerCorners[i],newInnerCorners[i + 1]};
    float[] c0=Arrays.copyOf(c,2);
    m0.mapPoints(c0);
    if (!CropMath.inclusiveContains(outer,c0[0],c0[1])) {
      float[] outerSide=CropMath.closestSide(c,outerCorners);
      float[] pathOfCorner={newInnerCorners[i],newInnerCorners[i + 1],oldInnerCorners[i],oldInnerCorners[i + 1]};
      float[] p=GeometryMathUtils.lineIntersect(pathOfCorner,outerSide);
      if (p == null) {
        p=new float[2];
        p[0]=oldInnerCorners[i];
        p[1]=oldInnerCorners[i + 1];
      }
switch (i) {
case 0:
case 1:
        ret.left=(p[0] > ret.left) ? p[0] : ret.left;
      ret.top=(p[1] > ret.top) ? p[1] : ret.top;
    break;
case 2:
case 3:
  ret.right=(p[0] < ret.right) ? p[0] : ret.right;
ret.top=(p[1] > ret.top) ? p[1] : ret.top;
break;
case 4:
case 5:
ret.right=(p[0] < ret.right) ? p[0] : ret.right;
ret.bottom=(p[1] < ret.bottom) ? p[1] : ret.bottom;
break;
case 6:
case 7:
ret.left=(p[0] > ret.left) ? p[0] : ret.left;
ret.bottom=(p[1] < ret.bottom) ? p[1] : ret.bottom;
break;
default :
break;
}
}
}
float[] retCorners=CropMath.getCornersFromRect(ret);
m0.mapPoints(retCorners);
innerRotated=retCorners;
reconstrain();
}

public void resizeInner ( RectF newInner ) { Matrix m = getRotMatrix ( ) ; Matrix m0 = getInverseRotMatrix ( ) ; float [ ] outerCorners = CropMath . getCornersFromRect ( outer ) ; m . mapPoints ( outerCorners ) ; float [ ] oldInnerCorners = CropMath . getCornersFromRect ( inner ) ; float [ ] newInnerCorners = CropMath . getCornersFromRect ( newInner ) ; RectF ret = new RectF ( newInner ) ; for ( int i = 0 ; i < newInnerCorners . length ; i += 2 ) { float [ ] c = { newInnerCorners [ i ] , newInnerCorners [ i + 1 ] } ; float [ ] c0 = Arrays . copyOf ( c , 2 ) ; m0 . mapPoints ( c0 ) ; if ( ! CropMath . inclusiveContains ( outer , c0 [ 0 ] , c0 [ 1 ] ) ) { float [ ] outerSide = CropMath . closestSide ( c , outerCorners ) ; float [ ] pathOfCorner = { newInnerCorners [ i ] , newInnerCorners [ i + 1 ] , oldInnerCorners [ i ] , oldInnerCorners [ i + 1 ] } ; float [ ] p = GeometryMathUtils . lineIntersect ( pathOfCorner , outerSide ) ; if ( p == null ) { p = new float [ 2 ] ; p [ 0 ] = oldInnerCorners [ i ] ; p [ 1 ] = oldInnerCorners [ i + 1 ] ; } switch ( i ) { case 0 : case 1 : ret . left = ( p [ 0 ] > ret . left ) ? p [ 0 ] : ret . left ; ret . top = ( p [ 1 ] > ret . top ) ? p [ 1 ] : ret . top ; break ; case 2 : case 3 : ret . right = ( p [ 0 ] < ret . right ) ? p [ 0 ] : ret . right ; ret . top = ( p [ 1 ] > ret . top ) ? p [ 1 ] : ret . top ; break ; case 4 : case 5 : ret . right = ( p [ 0 ] < ret . right ) ? p [ 0 ] : ret . right ; ret . bottom = ( p [ 1 ] < ret . bottom ) ? p [ 1 ] : ret . bottom ; break ; case 6 : case 7 : ret . left = ( p [ 0 ] > ret . left ) ? p [ 0 ] : ret . left ; ret . bottom = ( p [ 1 ] < ret . bottom ) ? p [ 1 ] : ret . bottom ; break ; default : break ; } } } float [ ] retCorners = CropMath . getCornersFromRect ( ret ) ; m0 . mapPoints ( retCorners ) ; innerRotated = retCorners ; reconstrain ( ) ; }
attempts to resize the inner rectangle . if this would cause it to leave the bounding rect , clips the inner rectangle to fit .
