aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/InkStrokeProperties.ts
diff options
context:
space:
mode:
authorvkalev <vjk1883@gmail.com>2021-08-11 20:02:23 -0400
committervkalev <vjk1883@gmail.com>2021-08-11 20:02:23 -0400
commitf4da02dac8ea9d92443533b82bee2557cdd8957e (patch)
tree9f7aedd8fff62ec7a99b003e1c1e16245614f9ae /src/client/views/InkStrokeProperties.ts
parent61d01ac7e7a2ff2df3a083aaa87ca5d8edbf71e8 (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.ts9
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);