Skip to content

Commit

Permalink
fix(android): maxWidth/maxHeight fix for capturePhoto
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Feb 29, 2024
1 parent d077147 commit 21a90c4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
} else if (expectedHeight == bm.height) {
scaleFactor = expectedWidth.toDouble() / bm.width
} else {
scaleFactor = Math.max(expectedWidth, expectedHeight).toDouble() / bm.width
scaleFactor = Math.min(expectedWidth / bm.width, expectedHeight / bm.height)
}
if (scaleFactor < 1) {
matrix.postScale(scaleFactor.toFloat(), scaleFactor.toFloat())
Expand Down

0 comments on commit 21a90c4

Please sign in to comment.