Skip to content
Snippets Groups Projects
Commit 5bce423b authored by Alexander Rose's avatar Alexander Rose
Browse files

fully mark carbohydrate terminal links from StructureElement.Loci

parent 01b0dde5
No related branches found
No related tags found
No related merge requests found
...@@ -136,7 +136,6 @@ function getTerminalLinkLoci(pickingId: PickingId, structure: Structure, id: num ...@@ -136,7 +136,6 @@ function getTerminalLinkLoci(pickingId: PickingId, structure: Structure, id: num
return EmptyLoci return EmptyLoci
} }
// TODO for each link when both of the link elements are in a StructureElement.Loci
function eachTerminalLink(loci: Loci, structure: Structure, apply: (interval: Interval) => boolean) { function eachTerminalLink(loci: Loci, structure: Structure, apply: (interval: Interval) => boolean) {
const { getTerminalLinkIndex } = structure.carbohydrates const { getTerminalLinkIndex } = structure.carbohydrates
let changed = false let changed = false
...@@ -161,6 +160,11 @@ function eachTerminalLink(loci: Loci, structure: Structure, apply: (interval: In ...@@ -161,6 +160,11 @@ function eachTerminalLink(loci: Loci, structure: Structure, apply: (interval: In
for (let i = 0, il = indices.length; i < il; ++i) { for (let i = 0, il = indices.length; i < il; ++i) {
if (apply(Interval.ofSingleton(indices[i]))) changed = true if (apply(Interval.ofSingleton(indices[i]))) changed = true
} }
} else {
const indices = getTerminalLinkIndices(e.unit, e.unit.elements[v])
for (let i = 0, il = indices.length; i < il; ++i) {
if (apply(Interval.ofSingleton(indices[i]))) changed = true
}
} }
}) })
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment