Commit 605b930b authored by Guillaume Seguin's avatar Guillaume Seguin

Correctly zoom to center when resizing

parent b9acfc99
......@@ -131,7 +131,8 @@ class wxGLPanel(wx.Panel):
self.mview_initialized = True
elif oldwidth is not None and oldheight is not None:
factor = min(self.width / oldwidth, self.height / oldheight)
self.zoom(factor)
x, y, _ = self.mouse_to_3d(self.width / 2, self.height / 2)
self.zoom(factor, (x, y))
# Wrap text to the width of the window
if self.GLinitialized:
......
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