diff options
| author | yipstanley <stanley_yip@brown.edu> | 2019-12-03 17:57:37 -0500 |
|---|---|---|
| committer | yipstanley <stanley_yip@brown.edu> | 2019-12-03 17:57:37 -0500 |
| commit | cb2edb837ffa9df5ad966d44ac0c26622d6579f0 (patch) | |
| tree | b90f01218511c26c69f862075953ce0196c4517d /src/client | |
| parent | 2781f77d46612720865ac0c1d115d6e013806103 (diff) | |
first hint of recognizer?
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 7267e94be..dcda13b00 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -337,9 +337,16 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) { if (this._points.length > 1) { let B = this.svgBounds; let points = this._points.map(p => ({ x: p.x - B.left, y: p.y - B.top })); - let inkDoc = Docs.Create.InkDocument(InkingControl.Instance.selectedColor, InkingControl.Instance.selectedTool, parseInt(InkingControl.Instance.selectedWidth), points, { width: B.width, height: B.height, x: B.left, y: B.top }); - this.addDocument(inkDoc); - this._points = []; + + let result = Utils.GestureRecognizer.Recognize(new Array(points)); + if (result) { + console.log(result.Name); + } + else { + let inkDoc = Docs.Create.InkDocument(InkingControl.Instance.selectedColor, InkingControl.Instance.selectedTool, parseInt(InkingControl.Instance.selectedWidth), points, { width: B.width, height: B.height, x: B.left, y: B.top }); + this.addDocument(inkDoc); + this._points = []; + } } document.removeEventListener("pointermove", this.onPointerMove); |
