Skip to content

Commit

Permalink
Added extra information to README.md on how to configure Differ to ad…
Browse files Browse the repository at this point in the history
…dress issues caused by antialiasing differences.
  • Loading branch information
darekbx committed Oct 16, 2024
1 parent 2f78447 commit 2dcf7c6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,26 @@ data class RoborazziOptions(
}
```
#### Image comparator custom settings
When comparing images, you may encounter differences due to minor changes related to antialiasing. You can use the options below to avoid this.
```kotlin
@get:Rule
val roborazziRule = RoborazziRule(
options = RoborazziRule.Options(
roborazziOptions = RoborazziOptions(
compareOptions = RoborazziOptions.CompareOptions(
changeThreshold = 0.01, // For 1% accepted difference
imageComparator = SimpleImageComparator(
maxDistance = 0.007F, // 0.001F is default value from Differ
vShift = 2, // Increasing the shift can help resolve antialiasing issues
hShift = 2 // Increasing the shift can help resolve antialiasing issues
)
)
)
)
)
```
### Dump mode
If you are having trouble debugging your test, try Dump mode as follows.
Expand Down

0 comments on commit 2dcf7c6

Please sign in to comment.