title: Scaling up a rect to match scaled bitmap
body: <p>I have a old Bitmap with size of 320*320 and I crop a rectangle from that bitmap and I get the following rectangle :</p>
  <pre><code>   val oldRect= RectF(42.884483, 92.28318, 287.36905, 160.71216)
  </code></pre>
  <p>I scaled the old bitmap to 3024*4032.</p>
  <p><strong>Now how can I scale the rectangle to match my new bitmap?</strong></p>
  <p>I came up with the following solution but I think it's wrong:</p>
  <pre><code>      val scaleFactorH = (newBitmap.width / oldBitmap.width).toFloat()
        val scaleFactorV = (newBitmap.height / oldBitmap.height).toFloat()
      
      
          val mX = oldRect.left.toInt() * scaleFactorH
          val mY = oldRect.top.toInt() * scaleFactorV
          val mW = oldRect.right.toInt() * scaleFactorH
          val mH = oldRect.bottom.toInt() * scaleFactorV
      
          val newRect = RecF(mX,mY,mW,mH)
  </code></pre>
  <p>Please help me. I have been struggling for days ):</p>