Fix PuzzleMerge.kt: use maxOf instead of max

This commit is contained in:
2026-03-05 21:14:25 +08:00
parent 65adbee8b8
commit a624dae001
12 changed files with 1 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -47,7 +47,7 @@ object PuzzleMerge {
context.contentResolver.openInputStream(uri).use { ins ->
BitmapFactory.decodeStream(ins, null, opts)
}
val inSample = maxOf(1, max(opts.outWidth / maxW, opts.outHeight / maxH))
val inSample = maxOf(1, maxOf(opts.outWidth / maxW, opts.outHeight / maxH))
val opts2 = BitmapFactory.Options().apply { inSampleSize = inSample }
context.contentResolver.openInputStream(uri).use { ins ->
BitmapFactory.decodeStream(ins, null, opts2)