Skip to content

Bug in text draw method when path_effects are set #4201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
BUG: Fixes a bug in the text draw method where the input renderer was…
… being overwritten when path_effects are set
  • Loading branch information
cimarronm committed Mar 7, 2015
commit 3f62859f29e186fb578da39a89ca366bace95aa8
16 changes: 9 additions & 7 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,16 +639,18 @@ def draw(self, renderer):

if self.get_path_effects():
from matplotlib.patheffects import PathEffectRenderer
renderer = PathEffectRenderer(self.get_path_effects(),
renderer)
textrenderer = PathEffectRenderer(self.get_path_effects(),
renderer)
else:
textrenderer = renderer

if self.get_usetex():
renderer.draw_tex(gc, x, y, clean_line,
self._fontproperties, angle, mtext=mtext)
textrenderer.draw_tex(gc, x, y, clean_line,
self._fontproperties, angle, mtext=mtext)
else:
renderer.draw_text(gc, x, y, clean_line,
self._fontproperties, angle,
ismath=ismath, mtext=mtext)
textrenderer.draw_text(gc, x, y, clean_line,
self._fontproperties, angle,
ismath=ismath, mtext=mtext)

gc.restore()
renderer.close_group('text')
Expand Down