From 45e6aa4948c22f26596c34537686e949a2dfd6a5 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 11 Nov 2026 16:39:55 -0800 Subject: [PATCH] Tests: MCP Pen closing drag keeps a clicked first anchor a corner tests::pen::a_drag_from_the_first_anchor_closes_the_path expected the closing drag to give the first anchor an outgoing handle mirroring the incoming one, which is the behavior #6634 reports. The first anchor is placed by a click, so after the close it stays a corner with its outgoing handle at the anchor. The test now checks that. --- crates/mcp/src/tests/pen.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/mcp/src/tests/pen.rs b/crates/mcp/src/tests/pen.rs index ae89a3b48..570b79496 100644 --- a/crates/mcp/src/tests/pen.rs +++ b/crates/mcp/src/tests/pen.rs @@ -46,7 +46,8 @@ fn cmd_with_the_pen_edits_the_path_being_drawn() { assert_eq!(paths(&h).iter().map(Vec::len).collect::>(), [3], "the same path, three anchors"); } -/// #501: a drag out of the first anchor closes the path, shaping the closing curve. +/// #501: a drag out of the first anchor closes the path, shaping the closing curve. #6634: the first +/// anchor was placed by a click, so it stays a corner and the first segment keeps its shape. #[test] fn a_drag_from_the_first_anchor_closes_the_path() { let mut h = Headless::new(); @@ -62,5 +63,6 @@ fn a_drag_from_the_first_anchor_closes_the_path() { d.walk(|n| closed.extend(n.path_data().map(|p| p.is_closed()))); assert_eq!(closed, [true], "one path, closed"); let first = paths(&h)[0][0]; - assert_eq!((first.h_in, first.h_out), (vectorcraft_geom::Point::new(40.0, 348.0), vectorcraft_geom::Point::new(160.0, 252.0))); + assert_eq!((first.h_in, first.h_out), (vectorcraft_geom::Point::new(40.0, 348.0), vectorcraft_geom::Point::new(100.0, 300.0))); + assert_eq!(first.kind, vectorcraft_geom::AnchorKind::Corner); }