fix(android): resize mode cover calculation (#4010)

This commit is contained in:
lovegaoshi
2024-07-18 01:53:50 -07:00
committed by GitHub
parent ab7e02e453
commit 9f382163d8

View File

@@ -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()
}
}