Skip to content

Commit

Permalink
Small fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite committed Jul 26, 2023
1 parent 27c1092 commit 408d1db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion coil-test-internal/src/main/java/coil/util/Bitmaps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ fun Bitmap.computeSimilarity(
*/
fun Bitmap.isSimilarTo(
expected: Bitmap,
ignoreAlpha: Boolean = false,
@FloatRange(from = -1.0, to = 1.0) threshold: Double = 0.99
): Boolean {
require(threshold in -1.0..1.0) { "Invalid threshold: $threshold" }
Expand All @@ -90,7 +91,7 @@ fun Bitmap.isSimilarTo(
"expected image (${expected.width}, ${expected.height})."
}

return computeSimilarity(expected) >= threshold
return computeSimilarity(expected, ignoreAlpha) >= threshold
}

/**
Expand Down

0 comments on commit 408d1db

Please sign in to comment.