diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/snake-bond-tool.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/snake-bond-tool.spec.ts index 26d5dc32eb..a825e870a7 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/snake-bond-tool.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/snake-bond-tool.spec.ts @@ -103,7 +103,7 @@ test.describe('Snake Bond Tool', () => { await bondTwoMonomers(page, peptide2, peptide3); await bondTwoMonomers(page, peptide3, peptide4); - // await takeEditorScreenshot(page); + await takeEditorScreenshot(page); }); test('Check snake mode arrange for peptides chain', async ({ page }) => { diff --git a/packages/ketcher-core/src/domain/entities/DrawingEntitiesManager.ts b/packages/ketcher-core/src/domain/entities/DrawingEntitiesManager.ts index caa309b233..9f04847fa7 100644 --- a/packages/ketcher-core/src/domain/entities/DrawingEntitiesManager.ts +++ b/packages/ketcher-core/src/domain/entities/DrawingEntitiesManager.ts @@ -973,7 +973,7 @@ export class DrawingEntitiesManager { ); ({ lastPosition, maxVerticalDistance } = nextMonomerResult); - this.getRnaBaseSideChainMonomers( + this.setRnaBaseSideChainMonomers( nucleotide.rnaBase, rearrangedMonomersSet, monomersWithSideChain, @@ -1027,7 +1027,7 @@ export class DrawingEntitiesManager { return { command, lastPosition, maxVerticalDistance }; } - private getRnaBaseSideChainMonomers( + private setRnaBaseSideChainMonomers( rnaBase: RNABase, rearrangedMonomersSet: Set, monomersWithSideChain: Array, @@ -1311,12 +1311,11 @@ export class DrawingEntitiesManager { firstMonomers = [firstMonomerInR2R1Chain]; } else { const oldMonomerPosition = monomerWithSideChain.position; - const newMonomerPosition = getFirstPosition(90, lastPosition); const operation = new MonomerMoveOperation( this.rearrangeChainModelChange.bind( this, monomerWithSideChain, - Coordinates.canvasToModel(newMonomerPosition), + Coordinates.canvasToModel(lastPosition), ), this.rearrangeChainModelChange.bind( this, @@ -1326,7 +1325,10 @@ export class DrawingEntitiesManager { ); rearrangedMonomersSet.add(monomerWithSideChain.id); command.addOperation(operation); - lastPosition = getFirstPosition(90, newMonomerPosition); + const height = + (monomerWithSideChain.renderer?.monomerSize.height ?? 0) + + VERTICAL_DISTANCE_FROM_MONOMER; + lastPosition = getFirstPosition(height, lastPosition); } const rearrangeResult = this.reArrangeMonomers( @@ -1344,18 +1346,6 @@ export class DrawingEntitiesManager { return { command, lastPosition }; } - public getPhosphateFromRnaBase(baseMonomer: RNABase) { - const r1PolymerBond = baseMonomer.attachmentPointsToBonds.R1; - const sugarMonomer = r1PolymerBond?.getAnotherMonomer(baseMonomer); - if (sugarMonomer && sugarMonomer instanceof Sugar) { - const phosphate = getNextMonomerInChain(sugarMonomer); - if (phosphate && phosphate instanceof Phosphate) { - return phosphate; - } - } - return undefined; - } - public setMicromoleculesHiddenEntities(struct: Struct) { struct.mergeInto(this.micromoleculesHiddenEntities); this.micromoleculesHiddenEntities.atoms = new Pool();