Commit a01a2b28 authored by Guillaume Seguin's avatar Guillaume Seguin

Don't force 3D viewer to be square

(and fix viewport scaling for non square viewers)
parent 6ece0b1f
......@@ -185,7 +185,7 @@ class wxGLPanel(wx.Panel):
glLoadIdentity()
self.setup_lights()
if self.orthographic:
ratio = factor * float(min(self.width, self.height)) / self.dist
ratio = factor * float(max(self.width, self.height)) / self.dist
self.zoom_factor = 1.0
glScalef(ratio, ratio, 1)
......
......@@ -85,4 +85,4 @@ class VizPane(wx.BoxSizer):
bgcolor = root.settings.bgcolor)
root.gwindow.Bind(wx.EVT_CLOSE, lambda x: root.gwindow.Hide())
if not isinstance(root.gviz, NoViz):
self.Add(root.gviz.widget, 1, flag = wx.SHAPED | wx.ALIGN_CENTER_HORIZONTAL)
self.Add(root.gviz.widget, 1, flag = wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL)
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