Skip to content

Commit 491c957

Browse files
tacaswellmeeseeksmachine
authored andcommitted
Backport PR #19052: Always pass integers to wx.Size.
1 parent d262e53 commit 491c957

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,8 @@ def __init__(self, num, fig):
922922
_set_frame_icon(self)
923923

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

10711072
def resize(self, width, height):
10721073
# docstring inherited
1073-
self.canvas.SetInitialSize(wx.Size(width, height))
1074+
self.canvas.SetInitialSize(
1075+
wx.Size(math.ceil(width), math.ceil(height)))
10741076
self.window.GetSizer().Fit(self.window)
10751077

10761078

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy