Artboards: cover Artboard from Layers / Group in the sampler test (#9302)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David MannandClaude Opus 5.5 committed 2026-10-25 03:23:22 +01:00
1 parent 078f7184bb
commit b3f3146402
1 file changed
+13
+13
View File
@@ -639,6 +639,19 @@ fn a_board_past_the_origin_moves_the_color_samplers_and_symmetry_with_the_docume
s.execute("layer.new.artboard", json!({"rect": [-200, 0, 100, 80]})).unwrap();
assert_eq!(samplers(&s), vec![[215.0, 15.0]]);
assert!(red_at(&s, 215, 15));
// A board made from layers (or a group) left of the canvas shifts by their overhang.
for cmd in ["layer.new.artboardFromLayers", "layer.new.artboardFromGroup"] {
let mut s = session(8);
add_square(&mut s, Rect::new(10, 10, 30, 30), [1.0, 0.0, 0.0, 1.0]);
s.execute("view.colorSamplers.add", json!({"x": 15, "y": 15})).unwrap();
add_square(&mut s, Rect::new(-30, 40, -10, 60), [0.0, 0.0, 1.0, 1.0]);
if cmd.ends_with("Group") {
s.execute("layer.groupLayers", json!({})).unwrap();
}
s.execute(cmd, json!({})).unwrap();
assert_eq!(samplers(&s), vec![[45.0, 15.0]], "{cmd}");
assert!(red_at(&s, 45, 15), "{cmd}");
}
// The "+" button left of a board at the origin shifts by the board and the gap.
let mut s = session(8);
let gid = board_with_square(&mut s);