fix: same_document ignores crate-private Document fields (main added painted_regions)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
SteamSmithandClaude Sonnet 5.5 committed 2026-11-28 21:11:06 -05:00
1 parent 219b3490c8
commit 14cd65692e
1 file changed
+3 -2
+3 -2
View File
@@ -19,9 +19,10 @@ fn session_at(texture_size: u32) -> Session {
}
/// Whether two documents hold the same content (`Document` has no `PartialEq`). Destructured so
/// a new field must be compared here too.
/// a new public field must be compared here too (crate-private fields, such as `painted_regions`,
/// can't be reached from an integration test).
fn same_document(a: &Document, b: &Document) -> bool {
let Document { project, pixels: PixelStore { layers, masks }, baked, bake_paint, resources, bake_meshes } = a;
let Document { project, pixels: PixelStore { layers, masks }, baked, bake_paint, resources, bake_meshes, .. } = a;
// Bake meshes have no equality (each holds a mesh and its BVH): the same high polys and cage
// stand in for them.
let same_meshes = bake_meshes.high.len() == b.bake_meshes.high.len() && bake_meshes.cage.is_some() == b.bake_meshes.cage.is_some();