palantir/plottable — pull request #123 by danmane (2014-02-26 19:04:34+00:00)
Title: Refactor truncateTextToLength out of Label and into Utils.

Add better unit testing.
Change API so it no longer modifies the element as a side-effect, but instead
takes the text, element, and length, measures the text in the element, returns
shorter text, and returns the textElement to its original state.

I think this is a better API so that it can be called multiple times without
getting into weird states, and its easier to reason about functions without
side effects.