mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 01:44:25 +00:00
Pen: the knot a press acts on is named knot, so the snapped point at stays the new anchor's place
This commit is contained in:
@@ -480,7 +480,7 @@ impl PenTool {
|
||||
} else {
|
||||
Kind::Pull
|
||||
};
|
||||
let at = if kind == Kind::Close { 0 } else { n.saturating_sub(1) };
|
||||
let knot = if kind == Kind::Close { 0 } else { n.saturating_sub(1) };
|
||||
let in_ctrl = match kind {
|
||||
Kind::Pull => {
|
||||
let mut p = at;
|
||||
@@ -491,12 +491,12 @@ impl PenTool {
|
||||
p
|
||||
}
|
||||
Kind::Retract => {
|
||||
let k = &mut draft.knots[at];
|
||||
let k = &mut draft.knots[knot];
|
||||
k.out_ctrl = k.anchor;
|
||||
k.smooth = false;
|
||||
k.in_ctrl
|
||||
}
|
||||
Kind::Close | Kind::Grab(_) | Kind::Move(_) => draft.knots[at].in_ctrl,
|
||||
Kind::Close | Kind::Grab(_) | Kind::Move(_) => draft.knots[knot].in_ctrl,
|
||||
};
|
||||
self.change(draft);
|
||||
self.drag = Some(Drag { origin: pos, kind, last: pos, moved: false, in_ctrl });
|
||||
|
||||
Reference in New Issue
Block a user