diff options
| author | geireann <geireann.lindfield@gmail.com> | 2021-08-17 21:11:58 -0400 |
|---|---|---|
| committer | geireann <geireann.lindfield@gmail.com> | 2021-08-17 21:11:58 -0400 |
| commit | 3b820202841a586506604db776e73a6cdc8d4015 (patch) | |
| tree | a8c1236cf6d686dd1b197e11f7bbd6f24f8f89e2 /src/client/views/InkStrokeProperties.ts | |
| parent | a634580c224c4113b6c8a4b83f17532e86b33225 (diff) | |
| parent | 412ec3b38b2ee396b2709d824f02b0e417f5d967 (diff) | |
Merge branch 'master' into search-david
Diffstat (limited to 'src/client/views/InkStrokeProperties.ts')
| -rw-r--r-- | src/client/views/InkStrokeProperties.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts index 76ca5b5ec..d527b2a05 100644 --- a/src/client/views/InkStrokeProperties.ts +++ b/src/client/views/InkStrokeProperties.ts @@ -266,8 +266,13 @@ export class InkStrokeProperties { this.applyFunction((doc: Doc, ink: InkData) => { const brokenIndices = Cast(doc.brokenInkIndices, listSpec("number")); if (brokenIndices) { - brokenIndices.splice(brokenIndices.indexOf(controlIndex), 1); - doc.brokenInkIndices = brokenIndices; + const newBrokenIndices = new List; + brokenIndices.forEach(brokenIndex => { + if (brokenIndex !== controlIndex) { + newBrokenIndices.push(brokenIndex); + } + }); + doc.brokenInkIndices = newBrokenIndices; const [controlPoint, handleA, handleB] = [ink[controlIndex], ink[handleIndexA], ink[handleIndexB]]; const oppositeHandleA = this.rotatePoint(handleA, controlPoint, Math.PI); const angleDifference = this.angleChange(handleB, oppositeHandleA, controlPoint); @@ -283,7 +288,7 @@ export class InkStrokeProperties { */ @action rotatePoint = (target: PointData, origin: PointData, angle: number) => { - let rotatedTarget = { X: target.X - origin.X, Y: target.Y - origin.Y }; + const rotatedTarget = { X: target.X - origin.X, Y: target.Y - origin.Y }; const newX = Math.cos(angle) * rotatedTarget.X - Math.sin(angle) * rotatedTarget.Y; const newY = Math.sin(angle) * rotatedTarget.X + Math.cos(angle) * rotatedTarget.Y; rotatedTarget.X = newX + origin.X; |
