diff options
| author | vkalev <vjk1883@gmail.com> | 2021-08-11 20:02:23 -0400 |
|---|---|---|
| committer | vkalev <vjk1883@gmail.com> | 2021-08-11 20:02:23 -0400 |
| commit | f4da02dac8ea9d92443533b82bee2557cdd8957e (patch) | |
| tree | 9f7aedd8fff62ec7a99b003e1c1e16245614f9ae /src/client/views/InkStrokeProperties.ts | |
| parent | 61d01ac7e7a2ff2df3a083aaa87ca5d8edbf71e8 (diff) | |
added circle shape generation using only 4 Bézier curves
Diffstat (limited to 'src/client/views/InkStrokeProperties.ts')
| -rw-r--r-- | src/client/views/InkStrokeProperties.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts index 76ca5b5ec..7ef6606c4 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; + let newBrokenIndices = new List; + for (let i = 0; i < brokenIndices.length; i++) { + if (brokenIndices[i] !== controlIndex) { + newBrokenIndices.push(brokenIndices[i]); + } + } + 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); |
