Fixed bug on biggest Viewer zoom factor preventing them to be used on Windows
authorLaurent Bessard
Sun, 12 May 2013 23:32:30 +0200
changeset 1123 55ed55ef7aea
parent 1122 84de51ab40d2
child 1124 b1705000eba1
Fixed bug on biggest Viewer zoom factor preventing them to be used on Windows
editors/Viewer.py
--- a/editors/Viewer.py	Sun May 12 23:30:00 2013 +0200
+++ b/editors/Viewer.py	Sun May 12 23:32:30 2013 +0200
@@ -74,7 +74,11 @@
               'size' : 12,
              }
 
-ZOOM_FACTORS = [math.sqrt(2) ** x for x in xrange(-6, 7)]
+if wx.Platform == '__WXMSW__':
+    MAX_ZOOMIN = 4
+else:
+    MAX_ZOOMIN = 7
+ZOOM_FACTORS = [math.sqrt(2) ** x for x in xrange(-6, MAX_ZOOMIN)]
 
 def GetVariableCreationFunction(variable_type):
     def variableCreationFunction(viewer, id, specific_values):
@@ -608,7 +612,7 @@
         self.MiniTextDC.SetFont(wx.Font(faces["size"] * 0.75, wx.SWISS, wx.NORMAL, wx.NORMAL, faceName = faces["helv"]))
         
         self.CurrentScale = None
-        self.SetScale(len(ZOOM_FACTORS) / 2, False)
+        self.SetScale(ZOOM_FACTORS.index(1.0), False)
         
         self.RefreshHighlightsTimer = wx.Timer(self, -1)
         self.Bind(wx.EVT_TIMER, self.OnRefreshHighlightsTimer, self.RefreshHighlightsTimer)