Skip to content

Commit

Permalink
Fixup - ensure [12CH3]CO will display okay.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Sep 12, 2017
1 parent e014a00 commit e55be31
Showing 1 changed file with 1 addition and 17 deletions.
Expand Up @@ -129,7 +129,7 @@ public boolean visible(IAtom atom, List<IBond> bonds, RendererModel model) {

// carbon isotopes are displayed
Integer mass = atom.getMassNumber();
if (mass != null && !isMajorIsotope(element.number(), mass)) return true;
if (mass != null) return true;

// no kink between bonds to imply the presence of a carbon and it must
// be displayed if the bonds have the same bond order
Expand All @@ -154,22 +154,6 @@ public boolean visible(IAtom atom, List<IBond> bonds, RendererModel model) {
return false;
}

/**
* Determine if the specified mass is the major isotope for the given atomic number.
*
* @param number atomic number
* @param mass atomic mass
* @return the mass is the major mass for the atomic number
*/
private static boolean isMajorIsotope(int number, int mass) {
try {
IIsotope isotope = Isotopes.getInstance().getMajorIsotope(number);
return isotope != null && isotope.getMassNumber().equals(mass);
} catch (IOException e) {
return false;
}
}

/**
* Check the valency of the atom.
*
Expand Down

0 comments on commit e55be31

Please sign in to comment.