aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/InkStrokeProperties.ts
diff options
context:
space:
mode:
authoreleanor-park <eleanor_park@brown.edu>2024-08-27 16:22:33 -0400
committereleanor-park <eleanor_park@brown.edu>2024-08-27 16:22:33 -0400
commit6f73686ec4dc3e01ae3eacc0150aa59eafea0325 (patch)
tree392d6ebcb6122326441afbb7dfe69ff4cb583c1d /src/client/views/InkStrokeProperties.ts
parentfd5278045e8c2e280d81cb965c0b2cc5afb59be8 (diff)
pulling from master
Diffstat (limited to 'src/client/views/InkStrokeProperties.ts')
-rw-r--r--src/client/views/InkStrokeProperties.ts7
1 files changed, 6 insertions, 1 deletions
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: