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):
glLoadIdentity()
self.setup_lights()
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.zoomed_width = 1.0
self.zoomed_height = 1.0
glScalef(ratio, ratio, 1)
self.zoomed_width = wratio / minratio
self.zoomed_height = hratio / minratio
glScalef(factor * minratio, factor * minratio, 1)
def OnDraw(self, *args, **kwargs):
"""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