From e199c0f39d25af0dbb7b6d41b7e1cf8e420131ed Mon Sep 17 00:00:00 2001 From: DD Date: Wed, 20 Dec 2017 11:54:43 -0500 Subject: [PATCH] Don't change opposite handle length when changing handle length --- src/helper/selection-tools/handle-tool.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/helper/selection-tools/handle-tool.js b/src/helper/selection-tools/handle-tool.js index 62e0b345..cbf78770 100644 --- a/src/helper/selection-tools/handle-tool.js +++ b/src/helper/selection-tools/handle-tool.js @@ -30,7 +30,7 @@ class HandleTool { } onMouseDrag (event) { this.selectedItems = getSelectedLeafItems(); - + for (const item of this.selectedItems) { for (const seg of item.segments) { // add the point of the segment before the drag started @@ -46,9 +46,8 @@ class HandleTool { !seg.handleOut.isColinear(seg.handleIn)) { seg.handleOut = seg.handleOut.add(event.delta); } else { - const oldLength = seg.handleOut.length; seg.handleOut = seg.handleOut.add(event.delta); - seg.handleIn = seg.handleOut.multiply(-seg.handleIn.length / oldLength); + seg.handleIn = seg.handleOut.multiply(-seg.handleIn.length / seg.handleOut.length); } } else if (seg.handleIn.selected && this.hitType === 'handle-in') { // if option is pressed or handles have been split, @@ -58,9 +57,8 @@ class HandleTool { seg.handleIn = seg.handleIn.add(event.delta); } else { - const oldLength = seg.handleIn.length; seg.handleIn = seg.handleIn.add(event.delta); - seg.handleOut = seg.handleIn.multiply(-seg.handleOut.length / oldLength); + seg.handleOut = seg.handleIn.multiply(-seg.handleOut.length / seg.handleIn.length); } } }