Skip to content

Commit 62ffa6f

Browse files
committed
wx: Use an integral font size.
This is a very-small partial revert of matplotlib#15292, which claimed that wx supports floats, but this no longer appears to be the case with Python 3.10, and looking at the C++ class constructor [1], should not have ever been supported. [1] https://docs.wxwidgets.org/3.0/classwx_font.html
1 parent dbe3622 commit 62ffa6f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 2 additions & 1 deletion
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()])

0 commit comments

Comments
 (0)