mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-24 16:16:37 +00:00
roar-python/libgui/GuiCanvasWxBackend.py:resize(): correctly set self.cellSize on non-Windows platforms (via blowfish.)
This commit is contained in:
parent
85e49a300e
commit
2bcaaedf73
@ -213,7 +213,10 @@ class GuiCanvasWxBackend():
|
|||||||
dc.SetFont(self._font); self.cellSize = dc.GetTextExtent("_");
|
dc.SetFont(self._font); self.cellSize = dc.GetTextExtent("_");
|
||||||
dc.Destroy()
|
dc.Destroy()
|
||||||
else:
|
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)]
|
winSize = [a * b for a, b in zip(canvasSize, self.cellSize)]
|
||||||
if self.canvasBitmap == None:
|
if self.canvasBitmap == None:
|
||||||
self.canvasBitmap = wx.Bitmap(winSize)
|
self.canvasBitmap = wx.Bitmap(winSize)
|
||||||
|
Loading…
Reference in New Issue
Block a user