Skip to content

Commit

Permalink
For n=1 one we want bonds to be left to right and not aligned at 30 d…
Browse files Browse the repository at this point in the history
…eg, e.g. "Cl-Ph".
  • Loading branch information
johnmay authored and egonw committed Aug 6, 2023
1 parent 9531e4b commit 24d5cc7
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -1045,6 +1045,16 @@ private void selectOrientation(IAtomContainer mol, double widthDiff, int alignDi
Point2d pivot = new Point2d(minmax[0] + ((minmax[2] - minmax[0]) / 2),
minmax[1] + ((minmax[3] - minmax[1]) / 2));

// n=1
if (bonds.size() == 1) {
IBond bond = bonds.get(0);
Point2d beg = bond.getBegin().getPoint2d();
Point2d end = bond.getEnd().getPoint2d();
double dx = beg.x - end.x;
double dy = beg.y - end.y;
GeometryUtil.rotate(mol, pivot, Math.atan2(dx, dy) + Math.PI/2);
return;
}

int[] dirhist = new int[180];

Expand Down

0 comments on commit 24d5cc7

Please sign in to comment.