File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
paparazzi/src/main/java/app/cash/paparazzi/internal Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,7 @@ internal object OffByTwo : Differ {
61
61
((expectedRgb and - 0x1000000 ).ushr(24 ) + (actualRgb and - 0x1000000 ).ushr(24 )) / 2 shl 24
62
62
val newRGB = avgAlpha or (newR shl 16 ) or (newG shl 8 ) or newB
63
63
64
- if (abs(deltaR) <= 2 && abs(deltaG) <= 2 && abs(deltaB) <= 2 // * && abs(deltaA) <= 2 *//
65
- ) {
64
+ if (abs(deltaR) <= 2 && abs(deltaG) <= 2 && abs(deltaB) <= 2 && abs(deltaA) <= 2 ) {
66
65
similarPixels++
67
66
deltaImage.setRGB(expectedWidth + x, y, 0xFF0000FF .toInt())
68
67
continue
Original file line number Diff line number Diff line change @@ -82,9 +82,9 @@ internal object PixelPerfect : Differ {
82
82
83
83
// If the delta diff is all black pixels, the computed difference is 0, but there are still
84
84
// different pixels. We can fallback to the amount of different pixels to less precise difference to ensure difference is reported.
85
- // if (differentPixels > 0 && percentDifference == 0f) {
86
- // percentDifference = differentPixels * 100 / (actualWidth * actualHeight.toDouble()).toFloat()
87
- // }
85
+ if (differentPixels > 0 && percentDifference == 0f ) {
86
+ percentDifference = differentPixels * 100 / (actualWidth * actualHeight.toDouble()).toFloat()
87
+ }
88
88
89
89
return if (percentDifference == 0f ) {
90
90
DiffResult .Identical (delta = deltaImage)
You can’t perform that action at this time.
0 commit comments