From 55e7db9b95f63d4896f85e3469a7945bd6c722ac Mon Sep 17 00:00:00 2001 From: Ramil Nugmanov Date: Tue, 9 Aug 2022 13:54:31 +0200 Subject: [PATCH] fixed overriding --- src/DrawerBase.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/DrawerBase.js b/src/DrawerBase.js index 7577b0a1..c29c3f7d 100644 --- a/src/DrawerBase.js +++ b/src/DrawerBase.js @@ -1736,18 +1736,22 @@ class DrawerBase { } } - for (var i = 0; i < this.rings.length; i++) { - if (this.rings[i].isBridged) { - startVertex = this.graph.vertices[this.rings[i].members[0]]; + if (startVertex === null) { + for (var i = 0; i < this.rings.length; i++) { + if (this.rings[i].isBridged) { + startVertex = this.graph.vertices[this.rings[i].members[0]]; + break; + } } } - if (this.rings.length > 0 && startVertex === null) { - startVertex = this.graph.vertices[this.rings[0].members[0]]; - } - if (startVertex === null) { - startVertex = this.graph.vertices[0]; + if (this.rings.length > 0) { + startVertex = this.graph.vertices[this.rings[0].members[0]]; + } + else { + startVertex = this.graph.vertices[0]; + } } this.createNextBond(startVertex, null, 0.0);