aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-23 11:56:35 -0400
committerbobzel <zzzman@gmail.com>2020-09-23 11:56:35 -0400
commitb97e7dcb31f4f8812d86b9b1944b912b544f3824 (patch)
tree1906cf17c08c49be6310f21052e9257a8c57ecfb /src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
parenta4085fdcd9841a30dbc08a04a3bf6cd208e246f0 (diff)
fixed link rendering to be less computationally inefficient
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx8
1 files changed, 5 insertions, 3 deletions
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<CollectionFreeFo
return top; //top <= document.documentElement.clientHeight && getComputedStyle(document.documentElement).overflow === "hidden";
}
- @computed get renderData() {
- this._start;
- if (SnappingManager.GetIsDragging() || !this.props.A.ContentDiv || !this.props.B.ContentDiv || !this.props.LinkDocs.length) {
+ @computed.struct get renderData() {
+ this._start; SnappingManager.GetIsDragging();
+ if (!this.props.A.ContentDiv || !this.props.B.ContentDiv || !this.props.LinkDocs.length) {
return undefined;
}
this.props.A.props.ScreenToLocalTransform().transform(this.props.B.props.ScreenToLocalTransform());
@@ -132,6 +132,8 @@ export class CollectionFreeFormLinkView extends React.Component<CollectionFreeFo
const bcont = this.props.B.ContentDiv.getElementsByClassName("linkAnchorBox-cont");
const adiv = (acont.length ? acont[0] : this.props.A.ContentDiv);
const bdiv = (bcont.length ? bcont[0] : this.props.B.ContentDiv);
+ for (let apdiv = adiv; apdiv; apdiv = apdiv.parentElement as any) if ((apdiv as any).hidden) return;
+ for (let apdiv = bdiv; apdiv; apdiv = apdiv.parentElement as any) if ((apdiv as any).hidden) return;
const a = adiv.getBoundingClientRect();
const b = bdiv.getBoundingClientRect();
const atop = this.visibleY(adiv);