--- a/editors/Viewer.py Tue Sep 25 19:00:03 2018 +0300
+++ b/editors/Viewer.py Wed Sep 26 12:13:23 2018 +0300
@@ -764,15 +764,14 @@
self.ElementRefreshList_lock = Lock()
dc = wx.ClientDC(self.Editor)
- font = wx.Font(faces["size"], wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["mono"])
- dc.SetFont(font)
- width, _height = dc.GetTextExtent("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
- while width > 260:
- faces["size"] -= 1
+ while True:
font = wx.Font(faces["size"], wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["mono"])
dc.SetFont(font)
width, _height = dc.GetTextExtent("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
- self.SetFont(font)
+ if width < 260:
+ break
+ faces["size"] -= 1
+ self.Editor.SetFont(font)
self.MiniTextDC = wx.MemoryDC(wx.EmptyBitmap(1, 1))
self.MiniTextDC.SetFont(wx.Font(faces["size"] * 0.75, wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["helv"]))