diff options
Diffstat (limited to 'src/client/views/nodes/LinkBox.tsx')
-rw-r--r-- | src/client/views/nodes/LinkBox.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/views/nodes/LinkBox.tsx b/src/client/views/nodes/LinkBox.tsx index 4f1d12c9b..3cbbbdeff 100644 --- a/src/client/views/nodes/LinkBox.tsx +++ b/src/client/views/nodes/LinkBox.tsx @@ -72,8 +72,9 @@ export class LinkBox extends ViewBoxBaseComponent<FieldViewProps>() { const a = this.anchor1; const b = this.anchor2; this._forceAnimate; + const docView = this._props.docViewPath().lastElement(); - if (a && b && !LightboxView.Contains(this.DocumentView?.())) { + if (a && b && !LightboxView.Contains(docView)) { // text selection bounds are not directly observable, so we have to // force an update when anything that could affect them changes (text edits causing reflow, scrolling) a.Document[a.LayoutFieldKey]; @@ -83,7 +84,7 @@ export class LinkBox extends ViewBoxBaseComponent<FieldViewProps>() { const axf = a.screenToViewTransform(); // these force re-render when a or b moves (so do NOT remove) const bxf = b.screenToViewTransform(); - const scale = a.CollectionFreeFormView === this.DocumentView?.().CollectionFreeFormView ? axf.Scale : bxf.Scale; + const scale = !docView ? 1 : a.CollectionFreeFormView === docView.CollectionFreeFormView ? axf.Scale : bxf.Scale; const at = a.getBounds?.transition; // these force re-render when a or b change size and at the end of an animated transition const bt = b.getBounds?.transition; // inquring getBounds() also causes text anchors to update whether or not they reflow (any size change triggers an invalidation) @@ -154,7 +155,7 @@ export class LinkBox extends ViewBoxBaseComponent<FieldViewProps>() { paddingRight: 4, paddingTop: 3, paddingBottom: 3, - background: DashColor((!this.DocumentView?.().isSelected() && highlightColor) || color) + background: DashColor((!docView?.isSelected() && highlightColor) || color) .fade(0.5) .toString(), }}> |