From 2bcaaedf73cb6323ed649f3ac9d09dba3f2a1309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 28 Mar 2020 10:27:53 +0100 Subject: [PATCH] roar-python/libgui/GuiCanvasWxBackend.py:resize(): correctly set self.cellSize on non-Windows platforms (via blowfish.) --- roar-python/libgui/GuiCanvasWxBackend.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roar-python/libgui/GuiCanvasWxBackend.py b/roar-python/libgui/GuiCanvasWxBackend.py index 31b5eda..54a3cd8 100644 --- a/roar-python/libgui/GuiCanvasWxBackend.py +++ b/roar-python/libgui/GuiCanvasWxBackend.py @@ -213,7 +213,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)