Skip to content

Commit

Permalink
Backmerge: #2865 – Incorrect display of carbon in attachment points f…
Browse files Browse the repository at this point in the history
…or functional groups (#2871)
  • Loading branch information
Nitvex committed Jul 5, 2023
1 parent e28af7b commit eb96da3
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@ function shouldDisplayStereoLabel(
}

function isLabelVisible(restruct, options, atom) {
const isAttachmentPointAtom = atom.a.attpnt != null
const isCarbon = atom.a.label.toLowerCase() === 'c'
const visibleTerminal =
options.showHydrogenLabels !== ShowHydrogenLabels.Off &&
options.showHydrogenLabels !== ShowHydrogenLabels.Hetero
Expand All @@ -653,6 +655,10 @@ function isLabelVisible(restruct, options, atom) {
atom.a.neighbors.length === 0 ||
(atom.a.neighbors.length < 2 && visibleTerminal)

if (isAttachmentPointAtom && atom.a.neighbors.length > 0 && isCarbon) {
return false
}

const shouldBeVisible =
neighborsLength ||
options.carbonExplicitly ||
Expand Down

0 comments on commit eb96da3

Please sign in to comment.