Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4734 - Preview: Monomers from macro mode are not erased by Erase tool in micro mode #4743

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function fromFragmentDeletion(restruct, rawSelection) {

selection.atoms.forEach((atomId) => {
const sgroup = struct.getGroupFromAtomId(atomId);
if (sgroup) {
if (sgroup && sgroup.isSuperatomWithoutLabel) {
const attachmentPoints = sgroup.getAttachmentPoints();
attachmentPoints.forEach((attachmentPoint) => {
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class SGroupDelete extends BaseOperation {
if (!sgroup) return;
this.data.type = sgroup?.item?.type;
this.data.pp = sgroup?.item?.pp;
this.data.oldSgroup = sgroup.item;

if (sgroup?.item?.type === 'DAT' && sgroupData) {
restruct.clearVisel(sgroupData.visel);
Expand Down
5 changes: 0 additions & 5 deletions packages/ketcher-react/src/script/editor/tool/eraser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
fromSimpleObjectDeletion,
fromTextDeletion,
FunctionalGroup,
MonomerMicromolecule,
SGroup,
} from 'ketcher-core';

Expand Down Expand Up @@ -345,10 +344,6 @@ class EraserTool implements Tool {
) {
const sGroup = sgroups.get(ci.id);

if (sGroup?.item instanceof MonomerMicromolecule) {
return;
}

this.editor.update(
fromFragmentDeletion(rnd.ctab, {
atoms: [...SGroup.getAtoms(molecule, sGroup?.item)],
Expand Down
Loading