diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index cef17ecca17e..589e32211557 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -17,6 +17,16 @@ For new features that were added to matplotlib, please see Changes in 1.3.x ================ +Changes in 1.3.1 +---------------- + +It is rare that we make an API change in a bugfix release, however, +for 1.3.1 since 1.3.0 the following change was made: + +- `text.Text.cached` (used to cache font objects) has been made into a + private variable. Among the obvious encapsulation benefit, this + removes this confusing-looking member from the documentation. + Code removal ------------ diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index ddf11901e018..c760aa2e9781 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -146,7 +146,7 @@ class Text(Artist): """ zorder = 3 - cached = maxdict(50) + _cached = maxdict(50) def __str__(self): return "Text(%g,%g,%s)" % (self._x, self._y, repr(self._text)) @@ -285,8 +285,8 @@ def _get_layout(self, renderer): of a rotated text when necessary. """ key = self.get_prop_tup() - if key in self.cached: - return self.cached[key] + if key in self._cached: + return self._cached[key] horizLayout = [] @@ -440,7 +440,7 @@ def get_text_width_height_descent(*kl, **kwargs): xs, ys = xys[:, 0], xys[:, 1] ret = bbox, zip(lines, whs, xs, ys), descent - self.cached[key] = ret + self._cached[key] = ret return ret def set_bbox(self, rectprops):