Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0e0039

Browse files
committed
ENH : add stale flag to AnchoredOffsetbox
1 parent 74ebf82 commit e0e0039

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/offsetbox.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,7 @@ def __init__(self, loc,
10141014
def set_child(self, child):
10151015
"set the child to be anchored"
10161016
self._child = child
1017+
self.stale = True
10171018

10181019
def get_child(self):
10191020
"return the child"
@@ -1071,6 +1072,7 @@ def set_bbox_to_anchor(self, bbox, transform=None):
10711072
self._bbox_to_anchor = Bbox.from_bounds(*bbox)
10721073

10731074
self._bbox_to_anchor_transform = transform
1075+
self.stale = True
10741076

10751077
def get_window_extent(self, renderer):
10761078
'''
@@ -1131,6 +1133,7 @@ def draw(self, renderer):
11311133

11321134
self.get_child().set_offset((px, py))
11331135
self.get_child().draw(renderer)
1136+
self.stale = False
11341137

11351138
def _get_anchored_bbox(self, loc, bbox, parentbbox, borderpad):
11361139
"""

0 commit comments

Comments
 (0)