Skip to content

Commit

Permalink
Scale AtomRadius in RadicalGenerator
Browse files Browse the repository at this point in the history
Change-Id: I38f932505ba215e241e5732bf58f015c0e01bb79
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
goglepox authored and egonw committed Jun 5, 2013
1 parent ea5ad5d commit 9be7452
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -66,7 +66,7 @@ public IRenderingElement generate(IAtomContainer container, RendererModel model)
// XXX : is this the best option?
final double ATOM_RADIUS =
((AtomRadius)model.getParameter(AtomRadius.class)).
getValue();
getValue()/ model.getParameter(Scale.class).getValue();

double modelRadius = SCREEN_RADIUS /
model.getParameter(Scale.class).getValue();
Expand All @@ -80,13 +80,13 @@ public IRenderingElement generate(IAtomContainer container, RendererModel model)
double xRadius = point.x;
double yRadius = point.y;
if (align == 1) {
xRadius += ATOM_RADIUS+singleElectronsPerAtom.get(atom)*ATOM_RADIUS;
xRadius += ATOM_RADIUS*2+singleElectronsPerAtom.get(atom)*modelRadius;
} else if (align == -1) {
xRadius -= ATOM_RADIUS+singleElectronsPerAtom.get(atom)*ATOM_RADIUS;
xRadius -= ATOM_RADIUS*2+singleElectronsPerAtom.get(atom)*modelRadius;
} else if (align == 2) {
yRadius += ATOM_RADIUS+singleElectronsPerAtom.get(atom)*ATOM_RADIUS;
yRadius += ATOM_RADIUS*2+singleElectronsPerAtom.get(atom)*modelRadius;
} else if (align == -2) {
yRadius -= ATOM_RADIUS+singleElectronsPerAtom.get(atom)*ATOM_RADIUS;
yRadius -= ATOM_RADIUS*2+singleElectronsPerAtom.get(atom)*modelRadius;
}
singleElectronsPerAtom.put(atom, singleElectronsPerAtom.get(atom)+1);
group.add(
Expand Down

0 comments on commit 9be7452

Please sign in to comment.