From 1d2f03125cbfd1c7a03f0000454de4d70e73d690 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 29 Sep 2021 22:51:21 -0400
Subject: made IsClosed a static function.  fixed warnings and errors.

---
 src/client/views/InkControlPtHandles.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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

diff --git a/src/client/views/InkControlPtHandles.tsx b/src/client/views/InkControlPtHandles.tsx
index 249a0fa64..8162f3fdc 100644
--- a/src/client/views/InkControlPtHandles.tsx
+++ b/src/client/views/InkControlPtHandles.tsx
@@ -11,6 +11,7 @@ import { UndoManager } from "../util/UndoManager";
 import { Colors } from "./global/globalEnums";
 import { InkStrokeProperties } from "./InkStrokeProperties";
 import { List } from "../../fields/List";
+import { InkingStroke } from "./InkingStroke";
 
 export interface InkControlProps {
     inkDoc: Doc;
@@ -120,7 +121,7 @@ export class InkControlPtHandles extends React.Component<InkControlProps> {
         }
 
         const screenSpaceLineWidth = this.props.screenSpaceLineWidth;
-        const closed = inkData.lastElement().X === inkData[0].X && inkData.lastElement().Y === inkData[0].Y;
+        const closed = InkingStroke.IsClosed(inkData);
         const nearestScreenPt = this.props.nearestScreenPt();
         const TagType = (broken?: boolean) => broken ? "rect" : "circle";
         const hdl = (control: { X: number, Y: number, I: number }, scale: number, color: string) => {
@@ -147,7 +148,7 @@ export class InkControlPtHandles extends React.Component<InkControlProps> {
                 pointerEvents="all"
                 cursor="default"
             />;
-        }
+        };
         return (<svg>
             {!nearestScreenPt ? (null) :
                 <circle key={"npt"}
-- 
cgit v1.2.3-70-g09d2

