Skip to content

Commit

Permalink
Changed the layout of radicals to have a smaller gap between them.
Browse files Browse the repository at this point in the history
Updated radical spacing

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
goglepox authored and egonw committed Jun 5, 2013
1 parent 9be7452 commit a80c30c
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -70,6 +70,7 @@ public IRenderingElement generate(IAtomContainer container, RendererModel model)

double modelRadius = SCREEN_RADIUS /
model.getParameter(Scale.class).getValue();
double modelSpacing = modelRadius * 2.5;
Map<IAtom,Integer> singleElectronsPerAtom = new HashMap<IAtom, Integer>();
for (ISingleElectron electron : container.singleElectrons()) {
IAtom atom = electron.getAtom();
Expand All @@ -80,13 +81,13 @@ public IRenderingElement generate(IAtomContainer container, RendererModel model)
double xRadius = point.x;
double yRadius = point.y;
if (align == 1) {
xRadius += ATOM_RADIUS*2+singleElectronsPerAtom.get(atom)*modelRadius;
xRadius += ATOM_RADIUS*4+singleElectronsPerAtom.get(atom)*modelSpacing;
} else if (align == -1) {
xRadius -= ATOM_RADIUS*2+singleElectronsPerAtom.get(atom)*modelRadius;
xRadius -= ATOM_RADIUS*4+singleElectronsPerAtom.get(atom)*modelSpacing;
} else if (align == 2) {
yRadius += ATOM_RADIUS*2+singleElectronsPerAtom.get(atom)*modelRadius;
yRadius += ATOM_RADIUS*4+singleElectronsPerAtom.get(atom)*modelSpacing;
} else if (align == -2) {
yRadius -= ATOM_RADIUS*2+singleElectronsPerAtom.get(atom)*modelRadius;
yRadius -= ATOM_RADIUS*4+singleElectronsPerAtom.get(atom)*modelSpacing;
}
singleElectronsPerAtom.put(atom, singleElectronsPerAtom.get(atom)+1);
group.add(
Expand Down

0 comments on commit a80c30c

Please sign in to comment.