8000 Merge pull request #17268 from meeseeksmachine/auto-backport-of-pr-17… · matplotlib/matplotlib@723d216 · GitHub
[go: up one dir, main page]

Skip to content

Commit 723d216

Browse files
authored
Merge pull request #17268 from meeseeksmachine/auto-backport-of-pr-17261-on-v3.2.x
Backport PR #17261 on branch v3.2.x (avoid calling wx.Bitmap() if width or height is zero)
2 parents 2f4a3e3 + 2046cde commit 723d216

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -776,14 +776,14 @@ def _onSize(self, evt):
776776
# no change in size
777777
return
778778
self._width, self._height = size
779-
# Create a new, correctly sized bitmap
780-
self.bitmap = wx.Bitmap(self._width, self._height)
781-
782779
self._isDrawn = False
783780

784781
if self._width <= 1 or self._height <= 1:
785782
return # Empty figure
786783

784+
# Create a new, correctly sized bitmap
785+
self.bitmap = wx.Bitmap(self._width, self._height)
786+
787787
dpival = self.figure.dpi
788788
winch = self._width / dpival
789789
hinch = self._height / dpival

0 commit comments

Comments
 (0)
0