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

Skip to content

Commit ae84e01

Browse files
dikshajangra12918-ossapple
authored andcommitted
Preserve user-set patchA in update_positions
Only update patchA internally if user has not manually set it.
1 parent ac535a1 commit ae84e01

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
@@ -2199,17 +2199,10 @@ def update_positions(self, renderer):
21992199
xy=(bbox.x0 - pad / 2, bbox.y0 - pad / 2),
22002200
width=bbox.width + pad, height=bbox.height + pad,
22012201
transform=IdentityTransform(), clip_on=False)
2202-
# Check if user manually set patchA externally
2203-
current_patchA = self.arrow_patch.patchA
2204-
internal_patchA = getattr(self, '_internal_patchA', None)
2205-
2206-
if current_patchA is not internal_patchA:
2207-
# patchA was manually set by the user, do not override it
2208-
pass
2209-
else:
2210-
# patchA was set internally, update it.
2211-
self.arrow_patch.set_patchA(patchA)
2212-
self._internal_patchA = patchA
2202+
if self.arrow_patch.patchA is getattr(
2203+
self, '_internal_patchA', None):
2204+
self.arrow_patch.set_patchA(patchA)
2205+
self._internal_patchA = patchA
22132206

22142207
@artist.allow_rasterization
22152208
def draw(self, renderer):

0 commit comments

Comments
 (0)