@@ -656,14 +656,21 @@ private IRenderingElement generateDoubleBond(IBond bond, boolean dashed) {
656656 // -- x x --
657657 return generateOffsetDoubleBond (bond , atom1 , atom2 , atom1Bonds .get (0 ), atom2Bonds , true , dashed );
658658 }
659- } else if (atom1Bonds .size () == 1 && !hasDisplayedSymbol (atom1 ) && (!hasDisplayedSymbol (atom2 ) || atom2Bonds .isEmpty ())) {
660- return generateOffsetDoubleBond (bond , atom1 , atom2 , atom1Bonds .get (0 ), atom2Bonds , dashed );
661- } else if (atom2Bonds .size () == 1 && !hasDisplayedSymbol (atom2 ) && (!hasDisplayedSymbol (atom1 ) || atom1Bonds .isEmpty ())) {
662- return generateOffsetDoubleBond (bond , atom2 , atom1 , atom2Bonds .get (0 ), atom1Bonds , dashed );
663- } else if (specialOffsetBondNextToWedge (atom1 , atom1Bonds ) && !hasDisplayedSymbol (atom1 )) {
664- return generateOffsetDoubleBond (bond , atom1 , atom2 , selectPlainSingleBond (atom1Bonds ), atom2Bonds , dashed );
665- } else if (specialOffsetBondNextToWedge (atom2 , atom2Bonds ) && !hasDisplayedSymbol (atom2 )) {
666- return generateOffsetDoubleBond (bond , atom2 , atom1 , selectPlainSingleBond (atom2Bonds ), atom1Bonds , dashed );
659+ } else if (!(hasDisplayedSymbol (atom1 ) && !hasDisplayedSymbol (atom2 ))) {
660+ if (atom1Bonds .size () == 1 && atom2Bonds .isEmpty ())
661+ return generateOffsetDoubleBond (bond , atom1 , atom2 , atom1Bonds .get (0 ), atom2Bonds , dashed );
662+ else if (atom2Bonds .size () == 1 && atom1Bonds .isEmpty ())
663+ return generateOffsetDoubleBond (bond , atom2 , atom1 , atom2Bonds .get (0 ), atom1Bonds , dashed );
664+ else if (specialOffsetBondNextToWedge (atom1 , atom1Bonds ))
665+ return generateOffsetDoubleBond (bond , atom1 , atom2 , selectPlainSingleBond (atom1Bonds ), atom2Bonds , dashed );
666+ else if (specialOffsetBondNextToWedge (atom2 , atom2Bonds ))
667+ return generateOffsetDoubleBond (bond , atom2 , atom1 , selectPlainSingleBond (atom2Bonds ), atom1Bonds , dashed );
668+ else if (atom1Bonds .size () == 1 )
669+ return generateOffsetDoubleBond (bond , atom1 , atom2 , atom1Bonds .get (0 ), atom2Bonds , dashed );
670+ else if (atom2Bonds .size () == 1 )
671+ return generateOffsetDoubleBond (bond , atom2 , atom1 , atom2Bonds .get (0 ), atom1Bonds , dashed );
672+ else
673+ return generateCenteredDoubleBond (bond , atom1 , atom2 , atom1Bonds , atom2Bonds );
667674 } else {
668675 if (dashed ) {
669676 return generateDashedBond (atom1 , atom2 );
0 commit comments