Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e03d956

Browse filesBrowse files
authored
Merge pull request #19052 from QuLogic/wx-int
FIX: Always pass integers to wx.Size.
2 parents 4ea80d2 + 1e3e9d4 commit e03d956
Copy full SHA for e03d956

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎lib/matplotlib/backends/backend_wx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_wx.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,8 @@ def __init__(self, num, fig):
909909
_set_frame_icon(self)
910910

911911
self.canvas = self.get_canvas(fig)
912-
self.canvas.SetInitialSize(wx.Size(fig.bbox.width, fig.bbox.height))
912+
w, h = map(math.ceil, fig.bbox.size)
913+
self.canvas.SetInitialSize(wx.Size(w, h))
913914
self.canvas.SetFocus()
914915
self.sizer = wx.BoxSizer(wx.VERTICAL)
915916
self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
@@ -1056,7 +1057,8 @@ def set_window_title(self, title):
10561057

10571058
def resize(self, width, height):
10581059
# docstring inherited
1059-
self.canvas.SetInitialSize(wx.Size(width, height))
1060+
self.canvas.SetInitialSize(
1061+
wx.Size(math.ceil(width), math.ceil(height)))
10601062
self.window.GetSizer().Fit(self.window)
10611063

10621064

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.