code: protected static boolean haveSameAspectRatio(RectF r1, RectF r2) {
          // Reduces precision to avoid problems when comparing aspect ratios.
          float srcRectRatio = MathUtils.truncate(MathUtils.getRectRatio(r1), 3);
          float dstRectRatio = MathUtils.truncate(MathUtils.getRectRatio(r2), 3);
          
          // Compares aspect ratios that allows for a tolerance range of [0, 0.01] 
          return (Math.abs(srcRectRatio-dstRectRatio) <= 0.01f);
      }
docs: Checks whether two {@link RectF} have the same aspect ratio.
  @param r1 the first rect.
  @param r2  the second rect.
  @return {@code true} if both rectangles have the same aspect ratio,
  {@code false} otherwise.