Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

rustfmt

moppeeer785c49a1d4e4
diff --git a/crates/tools/src/select.rs b/crates/tools/src/select.rs
index f073d063e..f6b42377d 100644
--- a/crates/tools/src/select.rs
+++ b/crates/tools/src/select.rs
@@ -703,19 +703,19 @@ impl SelectionTool {
self.drag = Drag::Anchor { id, si, ai, handle, start: p, at };
return vec![Action::Begin(if handle.is_some() { "Move Direction Handle".into() } else { "Move Anchor".into() })];
}
- // As in InDesign, the Direct Selection tool pressed on a corner or anchor of an object
- // that isn't selected selects it and moves just that point (Chris Nielsen's "The
- // InDesign Toolbox", 10:10: click outside, then pull a frame's corner).
- if self.direct
- && !ev.mods.shift
- && let Some((_, hit)) = cx.hit(p)
- && !cx.selection.contains(hit)
- && let Some((id, si, ai, None)) = anchor_at_in(cx, &[hit], p)
- {
- 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())];
- }
+ // As in InDesign, the Direct Selection tool pressed on a corner or anchor of an object
+ // that isn't selected selects it and moves just that point (Chris Nielsen's "The
+ // InDesign Toolbox", 10:10: click outside, then pull a frame's corner).
+ if self.direct
+ && !ev.mods.shift
+ && let Some((_, hit)) = cx.hit(p)
+ && !cx.selection.contains(hit)
+ && let Some((id, si, ai, None)) = anchor_at_in(cx, &[hit], p)
+ {
+ 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())];
+ }
// A selected placed graphic's own handles resize it inside its frame (the
// frame's anchors, under Direct Selection, come first).
if let Some((id, h)) = content_handle_at(cx, p)