Skip to content

Commit

Permalink
#4405 - Macro: Switching to Sequence mode causes page freeze (#4616)
Browse files Browse the repository at this point in the history
- refactored snake layout to work with ChainsCollection
- fixed chains sorting to use Y coordinate more than X
  • Loading branch information
rrodionov91 authored May 15, 2024
1 parent bb5239a commit bf462b4
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 359 deletions.
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 @@ -17,6 +17,7 @@ import {
selectPartOfMolecules,
openFileAndAddToCanvasMacro,
moveMouseAway,
scrollDown,
} from '@utils';
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
Expand Down Expand Up @@ -1046,12 +1047,15 @@ test.describe('Snake Bond Tool', () => {
Test case: Snake Mode
Description: Bonds connected through R1-R1 and R2-R2 connections should remain straight line. Connected through R2-R1 snake layout.
*/
const SCROLL_DELTA = 700;
await openFileAndAddToCanvasMacro(
`KET/two-peptide-chains-one-connected-through-r1-r1-and-r2-r2-another-r2-r1.ket`,
page,
);
await takeEditorScreenshot(page);
await selectSnakeLayoutModeTool(page);
await takeEditorScreenshot(page);
await scrollDown(page, SCROLL_DELTA);
await takeEditorScreenshot(page);
});
});
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.
10 changes: 10 additions & 0 deletions packages/ketcher-core/src/domain/entities/BaseMonomer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,4 +483,14 @@ export abstract class BaseMonomer extends DrawingEntity {
public get isModification() {
return this.monomerItem.props.MonomerNaturalAnalogCode !== this.label;
}

public get sideConnections() {
const sideConnections: PolymerBond[] = [];
this.forEachBond((bond) => {
if (bond.isSideChainConnection) {
sideConnections.push(bond);
}
});
return sideConnections;
}
}
Loading

0 comments on commit bf462b4

Please sign in to comment.