diff options
| author | bobzel <zzzman@gmail.com> | 2021-09-29 22:51:21 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2021-09-29 22:51:21 -0400 |
| commit | 1d2f03125cbfd1c7a03f0000454de4d70e73d690 (patch) | |
| tree | 22ff01b179e1430b7a59b6a5356eb54966486bb1 /src/client/views/InkControlPtHandles.tsx | |
| parent | b9adc2fec10d4509cd96558bb832f7c02bc70b25 (diff) | |
made IsClosed a static function. fixed warnings and errors.
Diffstat (limited to 'src/client/views/InkControlPtHandles.tsx')
| -rw-r--r-- | src/client/views/InkControlPtHandles.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
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"} |
