code: private double hydrogenXDodge(int hydrogens, int mass, TextOutline elementLabel, TextOutline hydrogenLabel,
                                    TextOutline hydrogenCount, TextOutline massLabel) {
          if (mass < 0 && hydrogens > 1) {
              return (elementLabel.getBounds().getMinX() - padding) - hydrogenCount.getBounds().getMaxX();
          } else if (mass >= 0) {
              if (hydrogens > 1) {
                  return (massLabel.getBounds().getMinX() + padding) - hydrogenCount.getBounds().getMaxX();
              } else if (hydrogens > 0) {
                  return (massLabel.getBounds().getMinX() - padding) - hydrogenLabel.getBounds().getMaxX();
              }
          }
          return 0;
      }
docs: If the hydrogens are position in from of the element we may need to move the hydrogen and
  hydrogen count labels. This code assesses the positions of the mass, hydrogen, and hydrogen
  count labels and determines the x-axis adjustment needed for the hydrogen label to dodge a
  collision.
  
  @param hydrogens     number of hydrogens
  @param mass          atomic mass
  @param elementLabel  element label outline
  @param hydrogenLabel hydrogen label outline
  @param hydrogenCount hydrogen count label outline
  @param massLabel     the mass label outline
  @return required adjustment to x-axis