From 5efa3c39c8c08ef47b282f909b78c3fe8c1949a4 Mon Sep 17 00:00:00 2001 From: Andrei Mazol Date: Mon, 15 Nov 2021 19:54:29 +0300 Subject: [PATCH] cherry pick commits from release 2.3 --- .../src/application/editor/operations/atom/index.ts | 2 +- .../src/application/editor/operations/sgroup/sgroupAtom.ts | 2 +- packages/ketcher-core/src/domain/entities/sgroup.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ketcher-core/src/application/editor/operations/atom/index.ts b/packages/ketcher-core/src/application/editor/operations/atom/index.ts index 71e12649ea..7dbbde258b 100644 --- a/packages/ketcher-core/src/application/editor/operations/atom/index.ts +++ b/packages/ketcher-core/src/application/editor/operations/atom/index.ts @@ -89,7 +89,7 @@ class AtomDelete extends BaseOperation { data: Data constructor(atomId?: any) { - super(OperationType.ATOM_DELETE, 4) + super(OperationType.ATOM_DELETE, 5) this.data = { aid: atomId, atom: null, pos: null } } diff --git a/packages/ketcher-core/src/application/editor/operations/sgroup/sgroupAtom.ts b/packages/ketcher-core/src/application/editor/operations/sgroup/sgroupAtom.ts index f5240715ed..d6389198af 100644 --- a/packages/ketcher-core/src/application/editor/operations/sgroup/sgroupAtom.ts +++ b/packages/ketcher-core/src/application/editor/operations/sgroup/sgroupAtom.ts @@ -66,7 +66,7 @@ class SGroupAtomRemove extends BaseOperation { data: Data constructor(sgroupId?: any, aid?: any) { - super(OperationType.S_GROUP_ATOM_REMOVE) + super(OperationType.S_GROUP_ATOM_REMOVE, 4) this.data = { sgid: sgroupId, aid } } diff --git a/packages/ketcher-core/src/domain/entities/sgroup.ts b/packages/ketcher-core/src/domain/entities/sgroup.ts index 582485d8de..f091537f0f 100644 --- a/packages/ketcher-core/src/domain/entities/sgroup.ts +++ b/packages/ketcher-core/src/domain/entities/sgroup.ts @@ -175,7 +175,7 @@ export class SGroup { } static getOffset(sgroup: SGroup): null | Vec2 { - if (!sgroup.pp) return null + if (!sgroup?.pp) return null return Vec2.diff(sgroup.pp, sgroup.bracketBox.p1) }