aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts8
1 files changed, 4 insertions, 4 deletions
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)