From 55fb94242e7b28c14da0705b1ea67f4633253ee1 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 30 Oct 2026 21:24:27 +0000 Subject: [PATCH] Integration: #902 Direct Selection anchor pull selects the frame, not its content --- crates/tools/src/select.rs | 2 +- crates/tools/src/tests.rs | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/tools/src/select.rs b/crates/tools/src/select.rs index 16ccbad0c..7f4c75780 100644 --- a/crates/tools/src/select.rs +++ b/crates/tools/src/select.rs @@ -714,7 +714,7 @@ impl SelectionTool { { let at = anchor_spread_point(cx, id, si, ai); self.drag = Drag::Anchor { id, si, ai, handle: None, start: p, at }; - return vec![Action::Exec("selection.set".into(), json!({"ids": [id], "content": true})), Action::Begin("Move Anchor".into())]; + return vec![Action::Exec("selection.set".into(), json!({"ids": [id], "content": false})), Action::Begin("Move Anchor".into())]; } // A selected placed graphic's own handles resize it inside its frame (the // frame's anchors, under Direct Selection, come first). diff --git a/crates/tools/src/tests.rs b/crates/tools/src/tests.rs index 03a19c73a..c216277aa 100644 --- a/crates/tools/src/tests.rs +++ b/crates/tools/src/tests.rs @@ -2082,3 +2082,18 @@ fn direct_selection_click_on_one_of_several_selected_frames_selects_only_it() { let acts = t.pointer(&cx, &PointerEvent::new(PointerKind::Down, p.x, p.y)); assert_eq!(acts, vec![Action::Exec("selection.set".into(), serde_json::json!({"ids": [a.0], "content": true}))]); } + +#[test] +fn pulling_a_corner_of_an_unselected_frame_selects_the_frame_not_its_content() { + let mut d = Document::new(&NewDocument::default()); + let a = add_rect(&mut d, Rect::new(100.0, 100.0, 200.0, 200.0)); + let (s, c, l) = (Selection::default(), Cache::new(), CanvasLayout::new(&d, false)); + let cx = ctx(&d, &s, &c, &l); + let p = spread_pt(&l, 200.0, 100.0); + let mut t = create("directSelection"); + let acts = t.pointer(&cx, &PointerEvent::new(PointerKind::Down, p.x, p.y)); + assert_eq!( + acts, + vec![Action::Exec("selection.set".into(), serde_json::json!({"ids": [a.0], "content": false})), Action::Begin("Move Anchor".into())] + ); +}