From ea6000690022d43b6bc8e1a546d28729a59faf7b Mon Sep 17 00:00:00 2001
From: vkalev <vjk1883@gmail.com>
Date: Wed, 28 Jul 2021 13:14:10 -0400
Subject: snapping broken tangency added

---
 src/client/views/InkControls.tsx | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

(limited to 'src/client/views/InkControls.tsx')

diff --git a/src/client/views/InkControls.tsx b/src/client/views/InkControls.tsx
index 090af10cc..6213a4075 100644
--- a/src/client/views/InkControls.tsx
+++ b/src/client/views/InkControls.tsx
@@ -37,20 +37,18 @@ export class InkControls extends React.Component<InkControlProps> {
             const order = controlIndex % 4;
             const handleIndexA = order === 2 ? controlIndex - 1 : controlIndex - 2;
             const handleIndexB = order === 2 ? controlIndex + 2 : controlIndex + 1;
-            const brokenIndices = Cast(this.props.inkDoc, listSpec("number"));
+            const brokenIndices = Cast(this.props.inkDoc.brokenInkIndices, listSpec("number"));
             setupMoveUpEvents(this, e,
                 (e: PointerEvent, down: number[], delta: number[]) => {
                     InkStrokeProperties.Instance?.moveControl(-delta[0] * screenScale, -delta[1] * screenScale, controlIndex);
                     return false;
                 },
                 () => controlUndo?.end(),
-                brokenIndices ?
-                    action((e: PointerEvent, doubleTap: boolean | undefined) => {
-                        if (doubleTap && brokenIndices.includes(controlIndex)) {
-                            InkStrokeProperties.Instance?.snapHandleTangent(controlIndex, handleIndexA, handleIndexB);
-                        }
-                    })
-                    : emptyFunction);
+                action((e: PointerEvent, doubleTap: boolean | undefined) => {
+                    if (doubleTap && brokenIndices && brokenIndices.includes(controlIndex)) {
+                        InkStrokeProperties.Instance?.snapHandleTangent(controlIndex, handleIndexA, handleIndexB);
+                    }
+                }));
         }
     }
 
-- 
cgit v1.2.3-70-g09d2

