diff options
| author | yipstanley <stanley_yip@brown.edu> | 2019-12-03 17:34:58 -0500 |
|---|---|---|
| committer | yipstanley <stanley_yip@brown.edu> | 2019-12-03 17:34:58 -0500 |
| commit | 2781f77d46612720865ac0c1d115d6e013806103 (patch) | |
| tree | e340c45a13eed609368db56a44d8600ade4e7053 /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | |
| parent | 494deb74c82443ef828cad4de57d0236ea72a0fa (diff) | |
improved multi-user touch stuff
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 9506ce084..7267e94be 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -418,7 +418,8 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) { handle1PointerMove = (e: TouchEvent) => { // panning a workspace if (!e.cancelBubble) { - let pt = e.targetTouches.item(0); + let myTouches = InteractionUtils.GetMyTargetTouches(e, this.prevPoints); + let pt = myTouches[0]; if (pt) { if (InkingControl.Instance.selectedTool === InkTool.None) { if (this._hitCluster && this.tryDragCluster(e)) { @@ -443,9 +444,9 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) { handle2PointersMove = (e: TouchEvent) => { // pinch zooming if (!e.cancelBubble) { - let pt1: Touch | null = e.targetTouches.item(0); - let pt2: Touch | null = e.targetTouches.item(1); - if (!pt1 || !pt2) return; + let myTouches = InteractionUtils.GetMyTargetTouches(e, this.prevPoints); + let pt1 = myTouches[0]; + let pt2 = myTouches[1]; if (this.prevPoints.size === 2) { let oldPoint1 = this.prevPoints.get(pt1.identifier); @@ -923,8 +924,8 @@ class CollectionFreeFormViewPannableContents extends React.Component<CollectionF const panx = -this.props.panX(); const pany = -this.props.panY(); const zoom = this.props.zoomScaling(); - return <div className={freeformclass} style={{ transform: `translate(${cenx}px, ${ceny}px) scale(${zoom}) translate(${panx}px, ${pany}px)` }}> - {this.props.children()} + return <div className={freeformclass} style={{ touchAction: "none", borderRadius: "inherit", transform: `translate(${cenx}px, ${ceny}px) scale(${zoom}) translate(${panx}px, ${pany}px)` }}> + {this.props.children} </div>; } }
\ No newline at end of file |
