calculateSquareRect

fun calculateSquareRect(width: Int, height: Int, changeOrientation: Boolean, origRect: Rect): Rect

Calculates Rect based on given origRect:

  • makes it square

  • ensures it is within given image bounds

  • as close to the size and position of origRect as possible