Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HonzaR committed Jan 9, 2025
1 parent f970546 commit cef0a7c
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class MlkitQrCodeAnalyzer(
barcode.rawValue?.let { value ->
Twig.debug { "Mlkit barcode value: $value" }
onQrCodeScanned(value)
// Note that we only take the first code from the list of discovered codes
return@addOnSuccessListener
}
}
}
Expand All @@ -83,13 +85,20 @@ private fun Bitmap.rotate(rotationDegrees: Int): Bitmap {
it.postRotate(rotationDegrees.toFloat())
}
return Bitmap.createBitmap(
// source
this,
// x
0,
// y
0,
// width
width,
// height
height,
// m
matrix,
true // Filter for better quality
// filter (Filter for better quality)
true
)
}

Expand All @@ -102,13 +111,13 @@ private fun Bitmap.crop(framePosition: FramePosition): Bitmap {
// TODO [#1380]: https://github.com/Electric-Coin-Company/zashi-android/issues/1380
return Bitmap.createBitmap(
this,
// left =
// left
(width * LEFT_OFFSET).toInt(),
// top =
// top
(height * TOP_OFFSET).toInt(),
// width =
// width
(width * WIDTH_OFFSET).toInt(),
// height =
// height
(height * HEIGHT_OFFSET).toInt(),
)
}
Expand Down

0 comments on commit cef0a7c

Please sign in to comment.