From 1e3e9d4a85d78ec2e389036500ad09ed88106e28 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 1 Dec 2020 04:34:43 -0500 Subject: [PATCH] Always pass integers to wx.Size. Fixes test failure on Python 3.10, https://bugzilla.redhat.com/show_bug.cgi?id=1902382 --- lib/matplotlib/backends/backend_wx.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 7a2c9fd48207..5e83baf8df70 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -909,7 +909,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) @@ -1056,7 +1057,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) 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