Skip to content

text update properties does not handle bbox properly #4942

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
Aug 22, 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
3 changes: 2 additions & 1 deletion lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ def update(self, kwargs):
"""
bbox = kwargs.pop('bbox', None)
super(Text, self).update(kwargs)
self.set_bbox(bbox) # depends on font properties
if bbox:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably to be safe, this should be if bbox is not None:. I can't be sure if bbox is ever a numpy array or not, and doing a test like that on a numpy array will result in errors in some versions, I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that is the case, we have a whole bunch of other places in the code have the same issue.

self.set_bbox(bbox) # depends on font properties

def __getstate__(self):
d = super(Text, self).__getstate__()
Expand Down