Skip to content

Commit f8a595d

Browse files
committed
Override select orientation for attachment points.
1 parent 363284f commit f8a595d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -893,18 +893,18 @@ private void refinePlacement(IAtomContainer molecule) {
893893
LayoutRefiner refiner = new LayoutRefiner(molecule, afix, bfix);
894894
refiner.refine();
895895

896-
// choose the orientation in which to display the structure
897-
if (selectOrientation) {
898-
899-
// check for attachment points, these override the direction which we rorate structures
900-
IAtom begAttach = null;
901-
for (IAtom atom : molecule.atoms()) {
902-
if (atom instanceof IPseudoAtom && ((IPseudoAtom) atom).getAttachPointNum() == 1) {
903-
begAttach = atom;
904-
break;
905-
}
896+
// check for attachment points, these override the direction which we rorate structures
897+
IAtom begAttach = null;
898+
for (IAtom atom : molecule.atoms()) {
899+
if (atom instanceof IPseudoAtom && ((IPseudoAtom) atom).getAttachPointNum() == 1) {
900+
begAttach = atom;
901+
selectOrientation = true;
902+
break;
906903
}
904+
}
907905

906+
// choose the orientation in which to display the structure
907+
if (selectOrientation) {
908908
// no attachment point, rotate to maximise horizontal spread etc.
909909
if (begAttach == null) {
910910
selectOrientation(molecule, DEFAULT_BOND_LENGTH, 1);

0 commit comments

Comments
 (0)