diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/GestureOverlay.tsx | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx index c1ac3ab06..4185050d2 100644 --- a/src/client/views/GestureOverlay.tsx +++ b/src/client/views/GestureOverlay.tsx @@ -154,19 +154,21 @@ export class GestureOverlay extends ObservableReactComponent<React.PropsWithChil const point3 = cuspArray[i + 2]; const triangleObject = { p1: { X: point1.X, Y: point1.Y }, p2: { X: point2.X, Y: point2.Y }, p3: { X: point3.X, Y: point3.Y } }; const otherInk = DocumentView.getDocumentView(doc)?.ComponentView as InkingStroke; - const { inkData: otherInkData } = otherInk?.inkScaledData() ?? { inkData: [] }; - const otherScreenPts = otherInkData.map(point => otherInk.ptToScreen(point)); - if (doc.title === 'line') { - if (this.doesLineIntersectTriangle(otherScreenPts, triangleObject)) { - docsToDelete.push(doc); - hasDocInTriangle = true; - cuspBooleanArray.push(true); - } - } else { - if (this.isAnyPointInTriangle(triangleObject, otherScreenPts)) { - docsToDelete.push(doc); - hasDocInTriangle = true; - cuspBooleanArray.push(true); + if (otherInk instanceof InkingStroke) { + const { inkData: otherInkData } = otherInk?.inkScaledData() ?? { inkData: [] }; + const otherScreenPts = otherInkData.map(point => otherInk.ptToScreen(point)); + if (doc.title === 'line') { + if (this.doesLineIntersectTriangle(otherScreenPts, triangleObject)) { + docsToDelete.push(doc); + hasDocInTriangle = true; + cuspBooleanArray.push(true); + } + } else { + if (this.isAnyPointInTriangle(triangleObject, otherScreenPts)) { + docsToDelete.push(doc); + hasDocInTriangle = true; + cuspBooleanArray.push(true); + } } } } |