aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvkalev <victor_kalev@brown.edu>2021-11-12 18:01:42 -0500
committervkalev <victor_kalev@brown.edu>2021-11-12 18:01:42 -0500
commit1fd8d25496d6a52902731cddc21969fe10cb2efa (patch)
tree93a8226d111ae3abcce414d40614a6933d57afa3
parent44c3ed6af9516c7bb91785934a997c7ab054ec5f (diff)
reverting NaN check when moving tangent handle
-rw-r--r--src/client/views/InkStrokeProperties.ts20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts
index 58d2992e0..02288bbb5 100644
--- a/src/client/views/InkStrokeProperties.ts
+++ b/src/client/views/InkStrokeProperties.ts
@@ -356,18 +356,16 @@ export class InkStrokeProperties {
const oldHandlePoint = ink[handleIndex];
const oppositeHandlePoint = ink[oppositeHandleIndex];
const controlPoint = ink[controlIndex];
+ const newHandlePoint = { X: ink[handleIndex].X - deltaX / xScale, Y: ink[handleIndex].Y - deltaY / yScale };
const inkCopy = ink.slice();
- if (!Number.isNaN(deltaX / xScale) && !Number.isNaN(deltaY / yScale)) {
- const newHandlePoint = { X: ink[handleIndex].X - deltaX / xScale, Y: ink[handleIndex].Y - deltaY / yScale };
- inkCopy[handleIndex] = newHandlePoint;
- const brokenIndices = Cast(doc.brokenInkIndices, listSpec("number"));
- const equivIndex = closed ? (controlIndex === 0 ? ink.length - 1 : controlIndex === ink.length - 1 ? 0 : -1) : -1;
- // Rotate opposite handle if user hasn't held 'Alt' key or not first/final control (which have only 1 handle).
- if ((!brokenIndices || (!brokenIndices?.includes(controlIndex) && !brokenIndices?.includes(equivIndex))) &&
- (closed || (handleIndex !== 1 && handleIndex !== ink.length - 2))) {
- const angle = this.angleChange(oldHandlePoint, newHandlePoint, controlPoint);
- inkCopy[oppositeHandleIndex] = this.rotatePoint(oppositeHandlePoint, controlPoint, angle);
- }
+ inkCopy[handleIndex] = newHandlePoint;
+ const brokenIndices = Cast(doc.brokenInkIndices, listSpec("number"));
+ const equivIndex = closed ? (controlIndex === 0 ? ink.length - 1 : controlIndex === ink.length - 1 ? 0 : -1) : -1;
+ // Rotate opposite handle if user hasn't held 'Alt' key or not first/final control (which have only 1 handle).
+ if ((!brokenIndices || (!brokenIndices?.includes(controlIndex) && !brokenIndices?.includes(equivIndex))) &&
+ (closed || (handleIndex !== 1 && handleIndex !== ink.length - 2))) {
+ const angle = this.angleChange(oldHandlePoint, newHandlePoint, controlPoint);
+ inkCopy[oppositeHandleIndex] = this.rotatePoint(oppositeHandlePoint, controlPoint, angle);
}
return inkCopy;
})