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 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
committed 2026-11-11 02:00:51 +01:00
1 parent 3bc90a79ce
commit 1d328c87aa
1 file changed
+3 -1
@@ -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();