10000 Backport PR #17261: avoid calling wx.Bitmap() if width or height is zero · matplotlib/matplotlib@2046cde · GitHub
[go: up one dir, main page]

Skip to content

Commit 2046cde

Browse files
QuLogicmeeseeksmachine
authored andcommitted
Backport PR #17261: avoid calling wx.Bitmap() if width or height is zero
1 parent 2f4a3e3 commit 2046cde

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