Only update snapshot if we didn't pass (#7455)

* Closes https://github.com/emilk/egui/issues/7449
This commit is contained in:
Emil Ernerfeldt 2025-08-15 12:21:51 +02:00 committed by GitHub
parent 839ee3eaf7
commit b24a56d3f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -421,13 +421,13 @@ fn try_image_snapshot_options_impl(
err,
})?;
if num_wrong_pixels as i64 <= *failed_pixel_count_threshold as i64 {
return Ok(());
}
if should_update_snapshots() {
update_snapshot()
} else {
if num_wrong_pixels as i64 <= *failed_pixel_count_threshold as i64 {
return Ok(());
}
Err(SnapshotError::Diff {
name,
diff: num_wrong_pixels,