private void initCropWindow() {

    float leftLimit = Math.max(BitmapUtils.getRectLeft(mBoundsPoints), 0);
    float topLimit = Math.max(BitmapUtils.getRectTop(mBoundsPoints), 0);
    float rightLimit = Math.min(BitmapUtils.getRectRight(mBoundsPoints), getWidth());
    float bottomLimit = Math.min(BitmapUtils.getRectBottom(mBoundsPoints), getHeight());

    if (rightLimit <= leftLimit || bottomLimit <= topLimit) {
      return;
    }

    RectF rect = new RectF();

    // Tells the attribute functions the crop window has already been initialized
    initializedCropWindow = true;

    float horizontalPadding = mInitialCropWindowPaddingRatio * (rightLimit - leftLimit);
    float verticalPadding = mInitialCropWindowPaddingRatio * (bottomLimit - topLimit);

    if (mInitialCropWindowRect.width() > 0 && mInitialCropWindowRect.height() > 0) {
      // Get crop window position relative to the displayed image.
      rect.left =
          leftLimit + mInitialCropWindowRect.left / mCropWindowHandler.getScaleFactorWidth();
      rect.top = topLimit + mInitialCropWindowRect.top / mCropWindowHandler.getScaleFactorHeight();
      rect.right =
          rect.left + mInitialCropWindowRect.width() / mCropWindowHandler.getScaleFactorWidth();
      rect.bottom =
          rect.top + mInitialCropWindowRect.height() / mCropWindowHandler.getScaleFactorHeight();

      // Correct for floating point errors. Crop rect boundaries should not exceed the source Bitmap
      // bounds.
      rect.left = Math.max(leftLimit, rect.left);
      rect.top = Math.max(topLimit, rect.top);
      rect.right = Math.min(rightLimit, rect.right);
      rect.bottom = Math.min(bottomLimit, rect.bottom);

    } else if (mFixAspectRatio && rightLimit > leftLimit && bottomLimit > topLimit) {

      // If the image aspect ratio is wider than the crop aspect ratio,
      // then the image height is the determining initial length. Else, vice-versa.
      float bitmapAspectRatio = (rightLimit - leftLimit) / (bottomLimit - topLimit);
      if (bitmapAspectRatio > mTargetAspectRatio) {

        rect.top = topLimit + verticalPadding;
        rect.bottom = bottomLimit - verticalPadding;

        float centerX = getWidth() / 2f;

        // dirty fix for wrong crop overlay aspect ratio when using fixed aspect ratio
        mTargetAspectRatio = (float) mAspectRatioX / mAspectRatioY;

        // Limits the aspect ratio to no less than 40 wide or 40 tall
        float cropWidth =
            Math.max(mCropWindowHandler.getMinCropWidth(), rect.height() * mTargetAspectRatio);

        float halfCropWidth = cropWidth / 2f;
        rect.left = centerX - halfCropWidth;
        rect.right = centerX + halfCropWidth;

      } else {

        rect.left = leftLimit + horizontalPadding;
        rect.right = rightLimit - horizontalPadding;

        float centerY = getHeight() / 2f;

        // Limits the aspect ratio to no less than 40 wide or 40 tall
        float cropHeight =
            Math.max(mCropWindowHandler.getMinCropHeight(), rect.width() / mTargetAspectRatio);

        float halfCropHeight = cropHeight / 2f;
        rect.top = centerY - halfCropHeight;
        rect.bottom = centerY + halfCropHeight;
      }
    } else {
      // Initialize crop window to have 10% padding w/ respect to image.
      rect.left = leftLimit + horizontalPadding;
      rect.top = topLimit + verticalPadding;
      rect.right = rightLimit - horizontalPadding;
      rect.bottom = bottomLimit - verticalPadding;
    }

    fixCropWindowRectByRules(rect);

    mCropWindowHandler.setRect(rect);
  }
Set the initial crop window size and position. This is dependent on the size and position of
the image being cropped.
core/src/main/java/com/theartofdev/edmodo/cropper/CropOverlayView.java