Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Document conservative blend preview coverage

jonathanwxh-cell6b3a6ffd8b22
diff --git a/crates/ui-egui/src/blend_preview.rs b/crates/ui-egui/src/blend_preview.rs
index b73ddd553..b5a203727 100644
--- a/crates/ui-egui/src/blend_preview.rs
+++ b/crates/ui-egui/src/blend_preview.rs
@@ -91,6 +91,9 @@ pub(crate) fn clip_damage(app: &mut PhotocraftApp, doc: DocId, revision: u64, ke
return region;
}
let shown = region.intersect(&visible);
+ // `covered` records only this refresh, including an empty intersection; it is not cumulative.
+ // Keep `region` so `uncovered` can recompute the next visible area. Forgetting older coverage
+ // can cause a redundant refresh, but cannot skip newly exposed pixels for this key.
p.covered = Some((key, region, shown));
shown
}