Skip to content

wx: Use integers in more places #19395

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

Merged
merged 2 commits into from
Jan 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,11 @@ def get_wx_font(self, s, prop):
font = self.fontd.get(key)
if font is not None:
return font
size = self.points_to_pixels(prop.get_size_in_points())
# Font colour is determined by the active wx.Pen
# TODO: It may be wise to cache font information
self.fontd[key] = font = wx.Font( # Cache the font and gc.
pointSize=self.points_to_pixels(prop.get_size_in_points()),
pointSize=int(size + 0.5),
family=self.fontnames.get(prop.get_name(), wx.ROMAN),
style=self.fontangles[prop.get_style()],
weight=self.fontweights[prop.get_weight()])
Expand Down Expand Up @@ -567,7 +568,7 @@ def start_event_loop(self, timeout=0):
raise RuntimeError("Event loop already running")
timer = wx.Timer(self, id=wx.ID_ANY)
if timeout > 0:
timer.Start(timeout * 1000, oneShot=True)
timer.Start(int(timeout * 1000), oneShot=True)
self.Bind(wx.EVT_TIMER, self.stop_event_loop, id=timer.GetId())
# Event loop handler for start/stop event loop
self._event_loop = wx.GUIEventLoop()
Expand Down