mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-30 10:03:56 +01:00
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:
1 parent
219b3490c8
commit
14cd65692e
1 file changed
+3
-2
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user