Confirmed and fixed in $H. With the Work Path selected in the Paths panel, \hit_active\ now searches only the Work Path, as it does for a selected saved path and as Path Selection does. A miss no longer falls through to the active shape.

New test \`with_the_work_path_selected_a_click_on_the_active_shape_does_nothing\`: the shape is active and the Work Path selected, and a Delete Anchor Point click on the shape's corner (650,250) leaves it unchanged with no history step. It fails on the previous head, where the corner knot was deleted. Anchor and direct_select tests: 107 passed; clippy \`-D warnings\` and fmt clean.
EOF2
cd C:/Users/thetr/.claude-personal-2/jobs/5c930f10/tmp && python cr_reply_resolve.py storytold/photocraft 12815 4525641135 $S/reply-12815-work-path.md 2>&1 | tail -2
Anchor tools: a selected Work Path is the only target too (#12762, #12705)

Review item on #12815: with the Work Path selected in the Paths panel, a miss on it fell through to the active shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove and wrote (review fix, no brief)
This commit is contained in:
Trevor BrownandClaude Opus 5.5 committed 2026-11-10 09:48:23 -05:00
1 parent acc2c880ed
commit f123782f4c
2 files changed
+16 -1

No files matched your search

@@ -93,3 +93,16 @@ fn with_a_saved_path_selected_a_click_on_the_active_shape_does_nothing() {
assert_eq!(shape_path(&mut app, shape), before);
assert_eq!(steps(&app), n);
}
#[test]
fn with_the_work_path_selected_a_click_on_the_active_shape_does_nothing() {
let (mut app, shape) = setup(Tool::DeleteAnchorPoint);
select_layer(&mut app, shape);
let path = json!({"subpaths": [{"closed": true, "knots": [[50, 450], [150, 450], [150, 550], [50, 550]]}]});
app.run("path.set", json!({"path": path})).unwrap();
app.ui.selected_path = Some("work".into());
let (before, n) = (shape_path(&mut app, shape), steps(&app));
click(&mut app, [650.0, 250.0]);
assert_eq!(shape_path(&mut app, shape), before);
assert_eq!(steps(&app), n);
}
+3 -1
View File
@@ -353,11 +353,13 @@ pub(crate) fn hit_target(app: &PhotocraftApp, p: [f64; 2], handles: bool) -> Opt
pub(crate) fn hit_active(app: &PhotocraftApp, p: [f64; 2]) -> Option<(PathRef, Path, Hit)> {
let tol = 6.0 / f64::from(app.point_zoom().max(0.01));
let st = app.session.active()?;
// A path selected in the Paths panel is the only target; otherwise the Pen draft first (as
// A path selected in the Paths panel (saved or Work Path) is the only target; otherwise the Pen draft first (as
// `candidates` builds it), then the active paths. The draft's destination is private to
// `vector_ui`, so it is not filtered here.
let targets: Vec<(PathRef, Path)> = match crate::vector_ui::selected_saved_path_index(app) {
Some((i, path)) => Some((PathRef::Saved(i), path)).filter(|(r, _)| writable(app, r)).into_iter().collect(),
// The Work Path selected in the Paths panel is the only target too, as for Path Selection.
None if app.ui.selected_path.as_deref() == Some("work") => active_paths(app).into_iter().filter(|(r, _)| *r == PathRef::Work).collect(),
None => {
let pen = app
.ui