From b33de1c9c64dcfd3936ea4ea25a0c24fff019d43 Mon Sep 17 00:00:00 2001 From: Nikita_Vozisov Date: Wed, 5 Jul 2023 12:07:12 +0300 Subject: [PATCH] =?UTF-8?q?#2865=20=E2=80=93=20Incorrect=20display=20of=20?= =?UTF-8?q?carbon=20in=20attachment=20points=20for=20functional=20groups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ketcher-core/src/application/render/restruct/reatom.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/ketcher-core/src/application/render/restruct/reatom.ts b/packages/ketcher-core/src/application/render/restruct/reatom.ts index 94314dad51..04c6b3162b 100644 --- a/packages/ketcher-core/src/application/render/restruct/reatom.ts +++ b/packages/ketcher-core/src/application/render/restruct/reatom.ts @@ -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 @@ -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 ||