Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,21 @@ def _onSize(self, evt):
"""

DEBUG_MSG("_onSize()", 2, self)
sz = self.GetParent().GetSizer()
if sz:
si = sz.GetItem(self)
if sz and si and not si.Proportion and not si.Flag & wx.EXPAND:
# managed by a sizer, but with a fixed size
size = self.GetMinSize()
else:
# variable size
size = self.GetClientSize()
if getattr(self, "_width", None):
if size == (self._width, self._height):
# no change in size
return
self._width, self._height = size
# Create a new, correctly sized bitmap
self._width, self._height = self.GetClientSize()
self.bitmap = wxc.EmptyBitmap(self._width, self._height)

self._isDrawn = False
Expand Down