Skip to content

Commit

Permalink
Merge pull request #19382 from meeseeksmachine/auto-backport-of-pr-19…
Browse files Browse the repository at this point in the history
…052-on-v3.3.x

Backport PR #19052 on branch v3.3.x (Always pass integers to wx.Size.)
  • Loading branch information
tacaswell committed Jan 27, 2021
2 parents d262e53 + 491c957 commit db5b330
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/matplotlib/backends/backend_wx.py
Expand Up @@ -922,7 +922,8 @@ def __init__(self, num, fig):
_set_frame_icon(self)

self.canvas = self.get_canvas(fig)
self.canvas.SetInitialSize(wx.Size(fig.bbox.width, fig.bbox.height))
w, h = map(math.ceil, fig.bbox.size)
self.canvas.SetInitialSize(wx.Size(w, h))
self.canvas.SetFocus()
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
Expand Down Expand Up @@ -1070,7 +1071,8 @@ def set_window_title(self, title):

def resize(self, width, height):
# docstring inherited
self.canvas.SetInitialSize(wx.Size(width, height))
self.canvas.SetInitialSize(
wx.Size(math.ceil(width), math.ceil(height)))
self.window.GetSizer().Fit(self.window)


Expand Down

0 comments on commit db5b330

Please sign in to comment.