From 1d328c87aa5800a334dcd488a68e23c9ea5dd4fd Mon Sep 17 00:00:00 2001 From: David Mann Date: Wed, 11 Nov 2026 02:00:51 +0100 Subject: [PATCH] Fix the mask-view test for the new gradient sample point (#12287) layer_mask_views_and_damage_on_the_downsampled_grid painted a 0 -> 37 mask gradient on a 37 px canvas and expected the last column above 245. With the sample point at (x - 0.5, y - 0.5), that column reads about 244 and the test failed in CI. End the drag on 36, as the PR does for the other tests that pinned the old sample point. Co-Authored-By: DuBearte Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/canvas/channel_view/tests.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/canvas/channel_view/tests.rs b/crates/ui-egui/src/canvas/channel_view/tests.rs index fa5d84e186..fd1d38d214 100644 --- a/crates/ui-egui/src/canvas/channel_view/tests.rs +++ b/crates/ui-egui/src/canvas/channel_view/tests.rs @@ -136,7 +136,9 @@ fn layer_mask_views_and_damage_on_the_downsampled_grid() { s.execute("layer.new.layer", json!({})).unwrap(); s.execute("edit.fill", json!({"color": "#0000ff"})).unwrap(); s.execute("layer.layerMask.revealAll", json!({})).unwrap(); - s.execute("paint.gradient", json!({"from": [0, 0], "to": [37, 0], "colors": ["#000000", "#ffffff"], "target": "mask"})).unwrap(); + // Pixels are sampled half a pixel up and left of their centre (#12018): a drag ending on 36 + // keeps the last column (sampled at 35.5) near white. + s.execute("paint.gradient", json!({"from": [0, 0], "to": [36, 0], "colors": ["#000000", "#ffffff"], "target": "mask"})).unwrap(); s.execute("view.layerMask", json!({"mode": "gray"})).unwrap(); let st = s.active().unwrap(); let b = st.doc.bounds();