diff options
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index e1ab1d3d3..56b2db48e 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -958,9 +958,10 @@ export namespace Doc { return doc; } - - export function LinkOtherAnchor(linkDoc: Doc, anchorDoc: Doc) { return Doc.AreProtosEqual(anchorDoc, Cast(linkDoc.anchor1, Doc) as Doc) ? Cast(linkDoc.anchor2, Doc) as Doc : Cast(linkDoc.anchor1, Doc) as Doc; } - export function LinkEndpoint(linkDoc: Doc, anchorDoc: Doc) { return Doc.AreProtosEqual(anchorDoc, Cast(linkDoc.anchor1, Doc) as Doc) ? "1" : "2"; } + export function LinkEndpoint(linkDoc: Doc, anchorDoc: Doc) { + return Doc.AreProtosEqual(anchorDoc, (linkDoc.anchor1 as Doc).annotationOn as Doc) || + Doc.AreProtosEqual(anchorDoc, linkDoc.anchor1 as Doc) ? "1" : "2"; + } export function linkFollowUnhighlight() { Doc.UnhighlightAll(); |