Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #19052 on branch v3.3.x (Always pass integers to wx.Size.) #19382

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
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