From 589eb4c76432db8b350ec4c8e8c56f0f956833e8 Mon Sep 17 00:00:00 2001 From: SteamSmith <341182916+SteamSmith@users.noreply.github.com> Date: Sat, 28 Nov 2026 10:29:26 -0500 Subject: [PATCH] test(path-cache): a filled path above an edit keeps its tiles from the cache Covers the footprint recorded by commit_fill; emptying it left every other test green. Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/path_tool.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/engine/src/path_tool.rs b/crates/engine/src/path_tool.rs index bd4c9715..785c779d 100644 --- a/crates/engine/src/path_tool.rs +++ b/crates/engine/src/path_tool.rs @@ -683,6 +683,15 @@ mod tests { assert_eq!(edit_row(&mut s, eid, 0, 0.79), [true, false, true], "a path over the change repaints"); } + #[test] + fn a_filled_path_above_an_edit_keeps_its_tiles() { + // The stroke at row 0.2 is edited; the closed, filled path above it lies in other tiles. + let (mut s, eid) = with_paths(&[0.2]); + execute(&mut s, "tool.path", &json!({"uvPoints": [[0.1, 0.7], [0.5, 0.7], [0.5, 0.9], [0.1, 0.9]], "closed": true, "fill": true, "commit": true})) + .unwrap(); + assert_eq!(edit_row(&mut s, eid, 0, 0.22), [true, false], "the fill above comes from the cache, with its pixels"); + } + #[test] fn removing_a_path_keeps_the_paths_above() { let (mut s, eid) = with_paths(&[0.2, 0.45, 0.8]);