mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-28 11:47:21 -06:00
G1: Alt-drag an existing ruler guide to swap its orientation
Match the public shortcut reference: Alt while dragging converts horizontal and vertical, with snapping on the new axis; guide.move accepts vertical on the index form. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -207,7 +207,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Move Guide",
|
||||
[],
|
||||
None,
|
||||
"{index, pos: pt} | {dx?, dy?: pt, copy?: bool} put ruler guide `index` at `pos`, or move the selected guides (vertical ones by dx, horizontal ones by dy); copy leaves them and selects the moved copies",
|
||||
"{index, pos: pt, vertical?: bool} | {dx?, dy?: pt, copy?: bool} put ruler guide `index` at `pos` (and swap its orientation when `vertical` is given), or move the selected guides (vertical ones by dx, horizontal ones by dy); copy leaves them and selects the moved copies",
|
||||
guides_unlocked,
|
||||
guide_move
|
||||
),
|
||||
@@ -769,6 +769,9 @@ pub(crate) fn guide_move(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
s.edit("Move Guide", |d, _| {
|
||||
if let Some(g) = d.guides.get_mut(i) {
|
||||
g.pos = pos;
|
||||
if p.get("vertical").is_some() {
|
||||
g.vertical = bool_or(p, "vertical", false);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
Reference in New Issue
Block a user