mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-12 06:35:03 +00:00
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.
This commit is contained in:
@@ -46,7 +46,8 @@ fn cmd_with_the_pen_edits_the_path_being_drawn() {
|
||||
assert_eq!(paths(&h).iter().map(Vec::len).collect::<Vec<_>>(), [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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user