Skip to content

Commit

Permalink
fix(android): resize mode cover calculation (#4010)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovegaoshi authored Jul 18, 2024
1 parent ab7e02e commit 9f38216
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class AspectRatioFrameLayout(context: Context) : FrameLayout(context) {

// Scale video if it doesn't fill the measuredWidth
if (width < measuredWidth) {
val scaleFactor: Int = measuredWidth / width
width *= scaleFactor
height = measuredHeight * scaleFactor
val scaleFactor: Float = measuredWidth.toFloat() / width
width = (scaleFactor * width).toInt()
height = (scaleFactor * height).toInt()
}
}

Expand Down

0 comments on commit 9f38216

Please sign in to comment.