opower/elroi — pull request #19 by gsmith85 (2013-07-10 20:36:04+00:00)
Title: Fix broken pixelsNeededForErrorMessages method

- Fixed broken logic in pixelsNeededForErrorMessages. This method
incorrectly calculated the height of the error message box.
- Added check to ensure that distortMaxValuesBy can never return a
negative scale or cause a division by zero exception. Both were
previously possible if the error/pointFlags/x2-labels had a combined
height that was larger than the height of the graph.
- Extracted code to inject the error message box to guarantee that the
same classes and styling are applied both when Elroi inject/removes
to garner size in pixelsNeededForErrorMessages and when Elroi
actually inject the visible error message.
- Replaced instances where the visibility-hidden class could be used
but wasn't.