Skip to content

Commit 0d749c5

Browse files
authored
Merge pull request #19395 from QuLogic/wx-py310
2 parents 603cf1a + be40c5c commit 0d749c5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/backends/backend_wx.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,11 @@ def get_wx_font(self, s, prop):
297297
font = self.fontd.get(key)
298298
if font is not None:
299299
return font
300+
size = self.points_to_pixels(prop.get_size_in_points())
300301
# Font colour is determined by the active wx.Pen
301302
# TODO: It may be wise to cache font information
302303
self.fontd[key] = font = wx.Font( # Cache the font and gc.
303-
pointSize=self.points_to_pixels(prop.get_size_in_points()),
304+
pointSize=int(size + 0.5),
304305
family=self.fontnames.get(prop.get_name(), wx.ROMAN),
305306
style=self.fontangles[prop.get_style()],
306307
weight=self.fontweights[prop.get_weight()])
@@ -567,7 +568,7 @@ def start_event_loop(self, timeout=0):
567568
raise RuntimeError("Event loop already running")
568569
timer = wx.Timer(self, id=wx.ID_ANY)
569570
if timeout > 0:
570-
timer.Start(timeout * 1000, oneShot=True)
571+
timer.Start(int(timeout * 1000), oneShot=True)
571572
self.Bind(wx.EVT_TIMER, self.stop_event_loop, id=timer.GetId())
572573
# Event loop handler for start/stop event loop
573574
self._event_loop = wx.GUIEventLoop()

0 commit comments

Comments
 (0)