libgui/GuiCanvasWxBackend.py:resize(): correctly set self.cellSize on non-Windows platforms (via blowfish.)

This commit is contained in:
Lucio Andrés Illanes Albornoz 2020-03-28 10:31:47 +01:00
parent 8fabe15792
commit b77db5eb4b

View File

@ -212,7 +212,10 @@ class GuiCanvasWxBackend():
dc.SetFont(self._font); self.cellSize = dc.GetTextExtent("_");
dc.Destroy()
else:
self._font = wx.Font(self.cellSize[0] + 1, wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
self._font = wx.Font(self.fontSize, wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
dc = wx.MemoryDC()
dc.SetFont(self._font); self.cellSize = dc.GetTextExtent("_");
dc.Destroy()
winSize = [a * b for a, b in zip(canvasSize, self.cellSize)]
if self.canvasBitmap == None:
self.canvasBitmap = wx.Bitmap(winSize)