From 5628b585fa6356d66cf2e7454be20e3b847ad22e Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 8 Jul 2022 12:37:06 -0400
Subject: fixes for drawing ink on pdf/image/etc.  fixes for showing
 contextMenu.  moved gestureOverlay into main dashboard area to avoid drawing
 on UI widgets.  more code cleanup to put things in reasonable places and
 avoid importing too much stuff.

---
 .../collectionFreeForm/CollectionFreeFormView.tsx  | 37 ++++++++++------------
 1 file changed, 17 insertions(+), 20 deletions(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 07ea26346..4174661d8 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -509,7 +509,6 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
         this._downY = this._lastY = e.pageY;
         if (e.button === 0 && !e.altKey && !e.ctrlKey && this.props.isContentActive(true)) {
             if (
-                !e.nativeEvent.cancelBubble &&
                 !this.props.Document._isGroup && // group freeforms don't pan when dragged -- instead let the event go through to allow the group itself to drag
                 !InteractionUtils.IsType(e, InteractionUtils.TOUCHTYPE) &&
                 !InteractionUtils.IsType(e, InteractionUtils.PENTYPE)
@@ -543,24 +542,22 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
 
     @action
     handle1PointerDown = (e: React.TouchEvent, me: InteractionUtils.MultiTouchEvent<React.TouchEvent>) => {
-        if (!e.nativeEvent.cancelBubble) {
-            // const myTouches = InteractionUtils.GetMyTargetTouches(me, this.prevPoints, true);
-            const pt = me.changedTouches[0];
-            if (pt) {
-                this._hitCluster = this.pickCluster(this.getTransform().transformPoint(pt.clientX, pt.clientY));
-                if (!e.shiftKey && !e.altKey && !e.ctrlKey && this.props.isContentActive(true)) {
-                    this.removeMoveListeners();
-                    this.addMoveListeners();
-                    this.removeEndListeners();
-                    this.addEndListeners();
-                    if (Doc.ActiveTool === InkTool.None) {
-                        this._lastX = pt.pageX;
-                        this._lastY = pt.pageY;
-                        e.preventDefault();
-                        e.stopPropagation();
-                    } else {
-                        e.preventDefault();
-                    }
+        // const myTouches = InteractionUtils.GetMyTargetTouches(me, this.prevPoints, true);
+        const pt = me.changedTouches[0];
+        if (pt) {
+            this._hitCluster = this.pickCluster(this.getTransform().transformPoint(pt.clientX, pt.clientY));
+            if (!e.shiftKey && !e.altKey && !e.ctrlKey && this.props.isContentActive(true)) {
+                this.removeMoveListeners();
+                this.addMoveListeners();
+                this.removeEndListeners();
+                this.addEndListeners();
+                if (Doc.ActiveTool === InkTool.None) {
+                    this._lastX = pt.pageX;
+                    this._lastY = pt.pageY;
+                    e.preventDefault();
+                    e.stopPropagation();
+                } else {
+                    e.preventDefault();
                 }
             }
         }
@@ -976,7 +973,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
 
     @action
     handle2PointersDown = (e: React.TouchEvent, me: InteractionUtils.MultiTouchEvent<React.TouchEvent>) => {
-        if (!e.nativeEvent.cancelBubble && this.props.isContentActive(true)) {
+        if (this.props.isContentActive(true)) {
             // const pt1: React.Touch | null = e.targetTouches.item(0);
             // const pt2: React.Touch | null = e.targetTouches.item(1);
             // // if (!pt1 || !pt2) return;
-- 
cgit v1.2.3-70-g09d2

