mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-10 18:10:01 -06:00
Selection: a selected object's masked art is reached the way a click goes
The check of a selected object's masked art looked at its own place only. A click goes down from the layer (or the isolated container) and never reaches a Shaper group's original shapes outside Construction mode, however deep the object lies in them; and below a layer whose Preview is off it hits art in outline. A press inside such a path's fill, or on a path in a Shaper group's hidden shapes, started a move. The way down to the selected object is now checked as a click goes: a Shaper group's part a click can't reach on it rules the object out, and a Preview-off layer on it (below the isolated container) makes the object count by its outline. Tests also cover Shift with Direct and Group Selection (a marquee) and an object a click hits over the masked art (it is selected). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EjfPR4a1jPek7r3nyFFNYv
This commit is contained in:
committed by
bflatastic
co-authored by
Claude Opus 5.5
parent
f793547a7f
commit
87fc61df79
@@ -117,6 +117,13 @@ fn a_press_where_a_mask_hides_a_selected_object_drags_it() {
|
||||
let mut t = SelectionTool::default();
|
||||
t.pointer(&c, &shift(PointerKind::Down, 370.0, 450.0));
|
||||
assert!(!t.pointer(&c, &shift(PointerKind::Drag, 390.0, 470.0)).iter().any(|a| matches!(a, Action::Begin(_))));
|
||||
// An object a click hits there wins: a press on a square over that point selects it.
|
||||
let mut d = d;
|
||||
let (front, l) = (d.alloc_id(), d.layers[0].id);
|
||||
let square = vectorcraft_geom::shapes::rectangle(Rect::new(350.0, 430.0, 390.0, 470.0));
|
||||
d.insert(Some(l), 2, vectorcraft_doc::Node::path(front, square, vectorcraft_doc::Appearance::default_art())).unwrap();
|
||||
let a = SelectionTool::default().pointer(&cx(&d, &picked, &p), &ev(PointerKind::Down, 370.0, 450.0));
|
||||
assert!(a.iter().any(|a| matches!(a, Action::Exec(c, v) if c == "select.set" && v["ids"] == json!([front.0]))), "{a:?}");
|
||||
}
|
||||
|
||||
/// #955: grabbed by an anchor and dropped near another object's anchor, the anchor lands
|
||||
|
||||
Reference in New Issue
Block a user