Skip to content

Commit

Permalink
#3280 - small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Olga Mazurina authored and rrodionov91 committed Oct 16, 2023
1 parent 2352b85 commit 95bcce3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/ketcher-core/src/application/editor/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ export class CoreEditor {
// todo we need to create abstraction layer for modes in future similar to the tools layer
private onSelectMode(isSnakeMode: boolean) {
PolymerBondRenderer.setSnakeMode(isSnakeMode);
let modelChanges;
modelChanges = this.drawingEntitiesManager.reArrangeChain(
const modelChanges = this.drawingEntitiesManager.reArrangeChain(
this.canvas.width.baseVal.value,
isSnakeMode,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ export class DrawingEntitiesManager {
chain[i - 1].position,
editorSettings,
);
let isMonomerFitCanvas =
const isMonomerFitCanvas =
prevPosition.x +
DISTANCE_BETWEEN_MONOMERS +
initCoords.x +
Expand Down Expand Up @@ -556,14 +556,15 @@ export class DrawingEntitiesManager {
private findChainByMonomer(monomer: BaseMonomer) {
let firstMonomer = monomer;
while (this.getPrevMonomer(firstMonomer)) {
firstMonomer = this.getPrevMonomer(firstMonomer)!;
firstMonomer = this.getPrevMonomer(firstMonomer) ?? firstMonomer;
}

const monomerChain = [] as BaseMonomer[];
let monomerInTheChain = firstMonomer;
monomerChain.push(monomerInTheChain);
while (this.getNextMonomer(monomerInTheChain)) {
monomerInTheChain = this.getNextMonomer(monomerInTheChain)!;
monomerInTheChain =
this.getNextMonomer(monomerInTheChain) ?? firstMonomer;
monomerChain.push(monomerInTheChain);
}
return monomerChain;
Expand Down

0 comments on commit 95bcce3

Please sign in to comment.