diff options
-rw-r--r-- | src/client/views/GestureOverlay.tsx | 6 | ||||
-rw-r--r-- | src/pen-gestures/ndollar.ts | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx index 46fa04d72..bf5b51a2d 100644 --- a/src/client/views/GestureOverlay.tsx +++ b/src/client/views/GestureOverlay.tsx @@ -117,7 +117,6 @@ export class GestureOverlay extends ObservableReactComponent<React.PropsWithChil this._points.push({ X: e.clientX, Y: e.clientY }); if (this._points.length > 1) { - const B = this.svgBounds; const initialPoint = this._points[0]; const xInGlass = initialPoint.X > (this._thumbX ?? Number.MAX_SAFE_INTEGER) && initialPoint.X < (this._thumbX ?? Number.MAX_SAFE_INTEGER) + this.height; const yInGlass = initialPoint.Y > (this._thumbY ?? Number.MAX_SAFE_INTEGER) - this.height && initialPoint.Y < (this._thumbY ?? Number.MAX_SAFE_INTEGER); @@ -142,7 +141,7 @@ export class GestureOverlay extends ObservableReactComponent<React.PropsWithChil } } @action - onPointerUp = (e: PointerEvent) => { + onPointerUp = () => { GestureOverlay.DownDocView = undefined; if (this._points.length > 1) { const B = this.svgBounds; @@ -157,7 +156,7 @@ export class GestureOverlay extends ObservableReactComponent<React.PropsWithChil // if we're not drawing in a toolglass try to recognize as gesture else { // need to decide when to turn gestures back on - const result = points.length > 2 && GestureUtils.GestureRecognizer.Recognize(new Array(points)); + const result = points.length > 2 && GestureUtils.GestureRecognizer.Recognize([points]); let actionPerformed = false; if (GestureOverlay.RecognizeGestures && result && result.Score > 0.7) { switch (result.Name) { @@ -414,6 +413,7 @@ export class GestureOverlay extends ObservableReactComponent<React.PropsWithChil this._strokes.map((l, i) => { const b = { left: -20000, right: 20000, top: -20000, bottom: 20000, width: 40000, height: 40000 }; // this.getBounds(l, true); return ( + // eslint-disable-next-line react/no-array-index-key <svg key={i} width={b.width} height={b.height} style={{ top: 0, left: 0, transform: `translate(${b.left}px, ${b.top}px)`, pointerEvents: 'none', position: 'absolute', zIndex: 30000, overflow: 'visible' }}> {InteractionUtils.CreatePolyline( l, diff --git a/src/pen-gestures/ndollar.ts b/src/pen-gestures/ndollar.ts index 5f1ea00dc..bdb79b446 100644 --- a/src/pen-gestures/ndollar.ts +++ b/src/pen-gestures/ndollar.ts @@ -309,7 +309,7 @@ export class NDollarRecognizer { // } - Recognize = (strokes: any[], useBoundedRotationInvariance: boolean = false, requireSameNoOfStrokes: boolean = false, useProtractor: boolean = true) => { + Recognize = (strokes: { X: number; Y: number }[][], useBoundedRotationInvariance: boolean = false, requireSameNoOfStrokes: boolean = false, useProtractor: boolean = true) => { const t0 = Date.now(); const points = CombineStrokes(strokes); // make one connected unistroke from the given strokes const candidate = new Unistroke('', useBoundedRotationInvariance, points); @@ -415,9 +415,9 @@ function MakeUnistrokes(strokes: any, orders: any[]) { return unistrokes; } -function CombineStrokes(strokes: any[]) { +function CombineStrokes(strokes: { X: number; Y: number }[][]) { const points: Point[] = []; - strokes.forEach(stroke => stroke.forEach((X: any, Y: any) => points.push(new Point(X, Y)))); + strokes.forEach(stroke => stroke.forEach(({ X, Y }) => points.push(new Point(X, Y)))); return points; } function Resample(points: any, n: any) { |