From 99aa4e6a7cd61cd96bb5caadee8690f0e3d9d147 Mon Sep 17 00:00:00 2001 From: nrq6993-a11y Date: Mon, 19 Oct 2026 09:53:42 +0300 Subject: [PATCH] G1: hide bounding box while dragging type-on-path brackets. Match corner-radius and pie-widget drags: the Selection tool reports a transforming drag so the canvas drops the sharp selection box during bracket moves. Co-authored-by: Cursor --- crates/tools/src/pathtype.rs | 5 +++++ crates/tools/src/select.rs | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/crates/tools/src/pathtype.rs b/crates/tools/src/pathtype.rs index 2b251f7ac..21fdaefc9 100644 --- a/crates/tools/src/pathtype.rs +++ b/crates/tools/src/pathtype.rs @@ -226,6 +226,11 @@ impl BracketDrag { Value::Object(m) } + /// The drag has left the click: the bracket is moving along the path. + pub fn adjusting(&self) -> bool { + self.began + } + pub fn finish(self) -> Vec { if self.began { vec![Action::Commit] } else { vec![] } } diff --git a/crates/tools/src/select.rs b/crates/tools/src/select.rs index a4720b7f3..f373aa09c 100644 --- a/crates/tools/src/select.rs +++ b/crates/tools/src/select.rs @@ -424,6 +424,7 @@ impl Tool for SelectionTool { State::Moving { began: true, .. } | State::Scaling { .. } | State::Rotating { .. } => true, State::Corner(c) => c.adjusting(), State::Pie(d) => d.adjusting(), + State::Bracket(b) => b.adjusting(), State::Mirror(d) => d.adjusting(), _ => false, } @@ -927,6 +928,22 @@ mod tests { assert!(t.transforming()); } + /// A type-on-path bracket drag is a transform, so the sharp selection box hides while the span moves. + #[test] + fn a_bracket_drag_counts_as_transforming_once_it_moves() { + let (d, id) = crate::testutil::doc_with_path_type(); + let mut s = Selection::default(); + s.add(id); + let p = paint(); + let cx = cx(&d, &s, &p); + let mut t = SelectionTool::default(); + assert!(!t.transforming()); + t.pointer(&cx, &ev(PointerKind::Down, 280.0, 290.0)); + assert!(!t.transforming(), "a press is still a click"); + t.pointer(&cx, &ev(PointerKind::Drag, 320.0, 290.0)); + assert!(t.transforming()); + } + /// #812: with Smart Guides on, hovering near an object's centre or an anchor labels it, and a /// press there grabs the object by that point. #[test]