Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Shorten RendererWx.get_wx_font.#15292
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
self.fontd[key] = font | ||
self.fontd[key] = font = wx.Font( # Cache the font and gc. | ||
pointSize=round(self.points_to_pixels(prop.get_size_in_points())), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This doesn't round the same, but I'm not sure if it's important:
In [9]:foriinrange(10): ...:i=i+0.5 ...:print(i,round(i),int(i+0.5)) ...:0.5011.5222.5233.5444.5455.5666.5677.5888.5899.51010
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Actually, upon further testing wx.Font accepts floats just fine here so I just dropped the rounding (after all freetype accepts sizes in multiples of (1/64) so there's no reason to drop that info...).
This is a very-small partial revert ofmatplotlib#15292, which claimed that wxsupports floats, but this no longer appears to be the case with Python3.10, and looking at the C++ class constructor [1], should not have everbeen supported.[1]https://docs.wxwidgets.org/3.0/classwx_font.html
PR Summary
PR Checklist