File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -948,8 +948,21 @@ def _onSize(self, evt):
948
948
"""
949
949
950
950
DEBUG_MSG ("_onSize()" , 2 , self )
951
+ sz = self .GetParent ().GetSizer ()
952
+ if sz :
953
+ si = sz .GetItem (self )
954
+ if sz and si and not si .Proportion and not si .Flag & wx .EXPAND :
955
+ # managed by a sizer, but with a fixed size
956
+ size = self .GetMinSize ()
957
+ else :
958
+ # variable size
959
+ size = self .GetClientSize ()
960
+ if getattr (self , "_width" , None ):
961
+ if size == (self ._width , self ._height ):
962
+ # no change in size
963
+ return
964
+ self ._width , self ._height = size
951
965
# Create a new, correctly sized bitmap
952
- self ._width , self ._height = self .GetClientSize ()
953
966
self .bitmap = wxc .EmptyBitmap (self ._width , self ._height )
954
967
955
968
self ._isDrawn = False
You can’t perform that action at this time.
0 commit comments