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

Macro: #3692 - Leaving groups are not displayed correctly in preview when switching to Micro mode #3825

Merged
Show file tree
Hide file tree
Changes from 3 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class MonomerMicromolecule extends SGroup {
super(type);
this.data.absolute = false;
this.data.attached = false;
this.convertedFromMacro = true;
}

public override getContractedPosition(struct: Struct) {
Expand Down
2 changes: 2 additions & 0 deletions packages/ketcher-core/src/domain/entities/sgroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export class SGroup {
pp: Vec2 | null;
data: any;
dataArea: any;
convertedFromMacro: boolean;
private readonly attachmentPoints: SGroupAttachmentPoint[];

constructor(type: string) {
Expand All @@ -106,6 +107,7 @@ export class SGroup {
this.neiAtoms = [];
this.attachmentPoints = [];
this.pp = null;
this.convertedFromMacro = false;
this.data = {
mul: 1, // multiplication count for MUL group
connectivity: 'ht', // head-to-head, head-to-tail or either-unknown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ function makeStruct(editor: Editor, sGroup: SGroup) {
makeRGroupAttachmentPoints(sGroup, existingStruct, struct, atomsIdMapping);
makeBonds(sGroup, existingStruct, struct, atomsIdMapping);

convertSGroupAttachmentPointsToRGroupAttachmentPoints(
struct,
sGroup,
atomsIdMapping,
);
if (!sGroup.convertedFromMacro) {
convertSGroupAttachmentPointsToRGroupAttachmentPoints(
struct,
sGroup,
atomsIdMapping,
);
}

return struct;
}
Expand Down
Loading