From b97e7dcb31f4f8812d86b9b1944b912b544f3824 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 23 Sep 2020 11:56:35 -0400 Subject: fixed link rendering to be less computationally inefficient --- src/client/views/PropertiesButtons.tsx | 2 +- .../collections/collectionFreeForm/CollectionFreeFormLinkView.tsx | 8 +++++--- .../collectionFreeForm/CollectionFreeFormLinksView.tsx | 8 +++----- src/client/views/nodes/DocumentView.tsx | 5 ++--- 4 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src/client/views') diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx index 00754c416..462091f63 100644 --- a/src/client/views/PropertiesButtons.tsx +++ b/src/client/views/PropertiesButtons.tsx @@ -397,7 +397,7 @@ export class PropertiesButtons extends React.Component<{}, {}> { {Doc.UserDoc().noviceMode ? (null) :
Edit onClick Script
} - + ; } @computed diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx index 79a540210..011e10b88 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx @@ -122,9 +122,9 @@ export class CollectionFreeFormLinkView extends React.Component { if (!drawnPairs.reduce((found, drawnPair) => { const match1 = (connection.a === drawnPair.a && connection.b === drawnPair.b); @@ -37,7 +35,7 @@ export class CollectionFreeFormLinksView extends React.Component { } render() { - return SnappingManager.GetIsDragging() ? (null) :
+ return
{this.uniqueConnections} diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 3d3599476..32c6fce36 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -208,7 +208,7 @@ export class DocumentView extends DocComponent(Docu // this._mainCont.current && (this.holdDisposer = InteractionUtils.MakeHoldTouchTarget(this._mainCont.current, this.handle1PointerHoldStart.bind(this))); if (!BoolCast(this.rootDoc.dontRegisterView, this.props.dontRegisterView)) { - DocumentManager.Instance.DocumentViews.push(this); + DocumentManager.Instance.AddView(this); } } @@ -234,8 +234,7 @@ export class DocumentView extends DocComponent(Docu this._holdDisposer?.(); Doc.UnBrushDoc(this.props.Document); if (!this.props.dontRegisterView) { - const index = DocumentManager.Instance.DocumentViews.indexOf(this); - index !== -1 && DocumentManager.Instance.DocumentViews.splice(index, 1); + DocumentManager.Instance.RemoveView(this); } } -- cgit v1.2.3-70-g09d2