From 6f73686ec4dc3e01ae3eacc0150aa59eafea0325 Mon Sep 17 00:00:00 2001 From: eleanor-park Date: Tue, 27 Aug 2024 16:22:33 -0400 Subject: pulling from master --- src/client/views/InkStrokeProperties.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/client/views/InkStrokeProperties.ts') diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts index 35d628a4e..ffda126f4 100644 --- a/src/client/views/InkStrokeProperties.ts +++ b/src/client/views/InkStrokeProperties.ts @@ -491,6 +491,12 @@ export class InkStrokeProperties { return inkCopy; }); + /** + * Function that "smooths" ink strokes by using the gesture recognizer to detect shapes and + * removing excess control points with the simplify-js package. + * @param inkDocs + * @param tolerance Determines how strong the smooth effect will be + */ @undoBatch smoothInkStrokes = (inkDocs: Doc[], tolerance: number = 5) => { inkDocs.forEach(inkDoc => { @@ -500,7 +506,6 @@ export class InkStrokeProperties { const result = inkData.length > 2 && GestureUtils.GestureRecognizer.Recognize([inkData]); console.log(result); - let polygonPoints: { X: number; Y: number }[] | undefined = undefined; if (result && (result.Name === 'line' ? result.Score > 0.92 : result.Score > 0.85)) { switch (result.Name) { case Gestures.Line: -- cgit v1.2.3-70-g09d2