Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitdb5b330

Browse files
authored
Merge pull request#19382 from meeseeksmachine/auto-backport-of-pr-19052-on-v3.3.x
Backport PR#19052 on branch v3.3.x (Always pass integers to wx.Size.)
2 parentsd262e53 +491c957 commitdb5b330

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
defresize(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)

[8]ページ先頭

©2009-2025 Movatter.jp