Skip to content

Commit a155690

Browse files
committed
Remove outdated comment in RendererBase.draw_text.
The line of code mentioned in the comment has been removed since 050ff69d, back in 2004... Replace with a comment in the code, closer to the place relevant for metrics calculations.
1 parent 7275ad9 commit a155690

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -513,21 +513,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
513513
If True, use mathtext parser. If "TeX", use tex for rendering.
514514
mtext : `~matplotlib.text.Text`
515515
The original text object to be rendered.
516-
517-
Notes
518-
-----
519-
**Note for backend implementers:**
520-
521-
When you are trying to determine if you have gotten your bounding box
522-
right (which is what enables the text layout/alignment to work
523-
properly), it helps to change the line in text.py::
524-
525-
if 0: bbox_artist(self, renderer)
526-
527-
to if 1, and then the actual bounding box will be plotted along with
528-
your text.
529516
"""
530-
531517
self._draw_text_as_path(gc, x, y, s, prop, angle, ismath)
532518

533519
def _get_text_path_transform(self, x, y, s, prop, angle, ismath):
@@ -604,6 +590,9 @@ def get_text_width_height_descent(self, s, prop, ismath):
604590
605591
Whitespace at the start and the end of *s* is included in the reported width.
606592
"""
593+
# Note: Using the ``bbox`` property of Text objects, backend
594+
# implementers can check their bounding box calculations (which impact
595+
# text layout).
607596
fontsize = prop.get_size_in_points()
608597

609598
if ismath == 'TeX':

0 commit comments

Comments
 (0)