aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/InkStrokeProperties.ts29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts
index 6b4cf9e50..adb9a7aa1 100644
--- a/src/client/views/InkStrokeProperties.ts
+++ b/src/client/views/InkStrokeProperties.ts
@@ -82,6 +82,21 @@ export class InkStrokeProperties {
const array = [{ x: controls[i].X, y: controls[i].Y }, { x: controls[i + 1].X, y: controls[i + 1].Y }, { x: controls[i + 2].X, y: controls[i + 2].Y }, { x: controls[i + 3].X, y: controls[i + 3].Y }];
const newsegs = new Bezier(array).split(t);
controls.splice(i, 4, ...[...newsegs.left.points.map(p => ({ X: p.x, Y: p.y })), ...newsegs.right.points.map(p => ({ X: p.x, Y: p.y }))]);
+
+ let brokenIndices = Cast(doc.brokenInkIndices, listSpec("number"));
+ // Updating the indices of the control points whose handle tangency has been broken.
+ if (brokenIndices) {
+ brokenIndices = new List(brokenIndices.map((control) => {
+ if (control >= i) {
+ return control + 4;
+ } else {
+ return control;
+ }
+ }));
+ }
+ doc.brokenInkIndices = brokenIndices;
+ this._currentPoint = -1;
+
return controls;
});
// this.applyFunction((doc: Doc, ink: InkData) => {
@@ -124,19 +139,7 @@ export class InkStrokeProperties {
// }
// }
- // let brokenIndices = Cast(doc.brokenInkIndices, listSpec("number"));
- // // Updating the indices of the control points whose handle tangency has been broken.
- // if (brokenIndices) {
- // brokenIndices = new List(brokenIndices.map((control) => {
- // if (control >= newIndex) {
- // return control + 4;
- // } else {
- // return control;
- // }
- // }));
- // }
- // doc.brokenInkIndices = brokenIndices;
- // this._currentPoint = -1;
+
// return newPoints;
// });
}