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

Skip to content

Commit 7e78aad

Browse files
Preserve user-set patchA in update_positions
Only update patchA internally if user has not manually set it.
1 parent f5f9eec commit 7e78aad

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

lib/matplotlib/text.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,17 +2101,10 @@ def update_positions(self, renderer):
21012101
xy=(bbox.x0 - pad / 2, bbox.y0 - pad / 2),
21022102
width=bbox.width + pad, height=bbox.height + pad,
21032103
transform=IdentityTransform(), clip_on=False)
2104-
# Check if user manually set patchA externally
2105-
current_patchA = self.arrow_patch.patchA
2106-
internal_patchA = getattr(self, '_internal_patchA', None)
2107-
2108-
if current_patchA is not internal_patchA:
2109-
# patchA was manually set by the user, do not override it
2110-
pass
2111-
else:
2112-
# patchA was set internally, update it.
2113-
self.arrow_patch.set_patchA(patchA)
2114-
self._internal_patchA = patchA
2104+
if self.arrow_patch.patchA is getattr(
2105+
self, '_internal_patchA', None):
2106+
self.arrow_patch.set_patchA(patchA)
2107+
self._internal_patchA = patchA
21152108

21162109
@artist.allow_rasterization
21172110
def draw(self, renderer):

0 commit comments

Comments
 (0)