From b24a56d3f7dbde53812f465c18868fe39cd7f84b Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 15 Aug 2025 12:21:51 +0200 Subject: [PATCH] Only update snapshot if we didn't pass (#7455) * Closes https://github.com/emilk/egui/issues/7449 --- crates/egui_kittest/src/snapshot.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/egui_kittest/src/snapshot.rs b/crates/egui_kittest/src/snapshot.rs index 6f565166..fea8ab8b 100644 --- a/crates/egui_kittest/src/snapshot.rs +++ b/crates/egui_kittest/src/snapshot.rs @@ -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,