diff --git a/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardBondGenerator.java b/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardBondGenerator.java index a2b2bf8b8a..aefd41522e 100644 --- a/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardBondGenerator.java +++ b/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardBondGenerator.java @@ -1241,7 +1241,7 @@ static int winding(IBond bond1, IBond bond2) { */ static Map ringPreferenceMap(IAtomContainer container) { - final IRingSet relevantRings = Cycles.relevant(container).toRingSet(); + final IRingSet relevantRings = Cycles.sssr(container).toRingSet(); final List rings = AtomContainerSetManipulator.getAllAtomContainers(relevantRings); Collections.sort(rings, new RingBondOffsetComparator()); diff --git a/tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java b/tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java index 518d15f39f..701970fcb6 100644 --- a/tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java +++ b/tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java @@ -526,7 +526,9 @@ private void generateCoordinates(Vector2d firstBondVector, boolean isConnected, // coordinates to simplest: 0,0. See bug #780545 logger.debug("Entry point of generateCoordinates()"); logger.debug("We have a molecules with " + numAtoms + " atoms."); - if (numAtoms == 1) { + if (numAtoms == 0) { + return; + } if (numAtoms == 1) { molecule.getAtom(0).setPoint2d(new Point2d(0, 0)); return; } else if (molecule.getBondCount() == 1 && molecule.getAtomCount() == 2) { @@ -1501,7 +1503,7 @@ private int layoutRingSet(Vector2d firstBondVector, IRingSet rs) { int result = 0; // Check for an exact match (identity) on the entire ring system - if (lookupRingSystem(rs, molecule, !macro || rs.getAtomContainerCount() > 1)) { + if (!macro && lookupRingSystem(rs, molecule, rs.getAtomContainerCount() > 1)) { for (IAtomContainer container : rs.atomContainers()) container.setFlag(CDKConstants.ISPLACED, true); rs.setFlag(CDKConstants.ISPLACED, true);