From 0a02dfa252f4eee451ba4ea74f82b90be489687e Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 1 Apr 2024 14:07:05 -0400 Subject: fixed exceptions on link to link positions --- src/client/documents/Documents.ts | 8 ++++---- src/client/views/linking/LinkMenuItem.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 20e74a3e1..29ec1d19e 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -1517,8 +1517,8 @@ export namespace DocUtils { return linkDoc; }); - const a = source.layout_unrendered ? 'link_anchor_1.annotationOn' : 'link_anchor_1'; - const b = target.layout_unrendered ? 'link_anchor_2.annotationOn' : 'link_anchor_2'; + const a = source.layout_unrendered ? 'link_anchor_1?.annotationOn' : 'link_anchor_1'; + const b = target.layout_unrendered ? 'link_anchor_2?.annotationOn' : 'link_anchor_2'; return makeLink( Docs.Create.LinkDocument( @@ -1533,8 +1533,8 @@ export namespace DocUtils { link_displayLine: linkSettings.link_displayLine, link_relationship: linkSettings.link_relationship, link_description: linkSettings.link_description, - x: ComputedField.MakeFunction(`(this.${a}.x+this.${b}.x)/2`) as any, - y: ComputedField.MakeFunction(`(this.${a}.y+this.${b}.y)/2`) as any, + x: ComputedField.MakeFunction(`((this.${a}?.x||0)+(this.${b}?.x||0))/2`) as any, + y: ComputedField.MakeFunction(`((this.${a}?.y||0)+(this.${b}?.y||0))/2`) as any, link_autoMoveAnchors: true, _lockedPosition: true, _layout_showCaption: '', // removed since they conflict with showing a link with a LinkBox (ie, line, not comparison box) diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx index 81dd0eb98..a2c9d10b6 100644 --- a/src/client/views/linking/LinkMenuItem.tsx +++ b/src/client/views/linking/LinkMenuItem.tsx @@ -183,7 +183,7 @@ export class LinkMenuItem extends ObservableReactComponent { Show/Hide Link}> -
+
-- cgit v1.2.3-70-g09d2