Skip to content

Commit

Permalink
Merge pull request #249 from cdk/patch/layout_091116
Browse files Browse the repository at this point in the history
Patch/layout 091116
  • Loading branch information
egonw authored Nov 9, 2016
2 parents 1ec0d36 + 15e2c81 commit a46646d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ static int winding(IBond bond1, IBond bond2) {
*/
static Map<IBond, IAtomContainer> ringPreferenceMap(IAtomContainer container) {

final IRingSet relevantRings = Cycles.relevant(container).toRingSet();
final IRingSet relevantRings = Cycles.sssr(container).toRingSet();
final List<IAtomContainer> rings = AtomContainerSetManipulator.getAllAtomContainers(relevantRings);

Collections.sort(rings, new RingBondOffsetComparator());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a46646d

Please sign in to comment.