Skip to content

Commit

Permalink
Updated how_to_use.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
darekbx committed Oct 16, 2024
1 parent 2dcf7c6 commit 1912c65
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/topics/how_to_use.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,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 1912c65

Please sign in to comment.