Files
effectcraft/crates/keyframe/tests/feather_remove.rs
T
NetterSilverandClaude Haiku 5.5 b3ff5d4aa6 Fix feather points when deleting first vertex of a closed mask path
Found while testing crates/keyframe/src/value.rs:79-95 (ShapePath::feather_after_remove, called from crates/engine/src/commands/mask.rs:330)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 18:51:57 +02:00

15 lines
560 B
Rust

use effectcraft_keyframe::{FeatherPoint, ShapePath};
#[test]
fn removing_first_vertex_of_closed_path_merges_closing_segment() {
let mut p = ShapePath::rect([0.0, 0.0], 10.0, 10.0);
let fp = |segment| FeatherPoint { segment, t: 0.5, radius: 1.0, tension: 0.0 };
p.feather = vec![fp(3), fp(0)];
p.vertices.remove(0);
p.in_tangents.remove(0);
p.out_tangents.remove(0);
p.feather_after_remove(0);
let got: Vec<(usize, f64)> = p.feather.iter().map(|f| (f.segment, f.t)).collect();
assert_eq!(got, vec![(2, 0.25), (2, 0.75)]);
}