Commit 82da744c authored by Guillaume Seguin's avatar Guillaume Seguin

Apply the same logic as in 2b00ea6a to zoom initialization (#520)

parent d68ff6ac
...@@ -203,11 +203,13 @@ class wxGLPanel(wx.Panel): ...@@ -203,11 +203,13 @@ class wxGLPanel(wx.Panel):
glLoadIdentity() glLoadIdentity()
self.setup_lights() self.setup_lights()
if self.orthographic: if self.orthographic:
ratio = factor * float(min(self.width, self.height)) / self.dist wratio = self.width / self.dist
hratio = self.height / self.dist
minratio = float(min(wratio, hratio))
self.zoom_factor = 1.0 self.zoom_factor = 1.0
self.zoomed_width = 1.0 self.zoomed_width = wratio / minratio
self.zoomed_height = 1.0 self.zoomed_height = hratio / minratio
glScalef(ratio, ratio, 1) glScalef(factor * minratio, factor * minratio, 1)
def OnDraw(self, *args, **kwargs): def OnDraw(self, *args, **kwargs):
"""Draw the window.""" """Draw the window."""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment