Commit 5a430c56 authored by Guillaume Seguin's avatar Guillaume Seguin

Improve gviz resizing behavior

parent 7dceaa06
...@@ -219,11 +219,10 @@ class gviz(wx.Panel): ...@@ -219,11 +219,10 @@ class gviz(wx.Panel):
float(self.size[1] - 1)/self.build_dimensions[1])] float(self.size[1] - 1)/self.build_dimensions[1])]
def resize(self, event): def resize(self, event):
oldside = max(1.0, min(self.size)) old_basescale = self.basescale
self.size = self.GetClientSizeTuple() self.size = self.GetClientSizeTuple()
self.update_basescale() self.update_basescale()
newside = max(1.0, min(self.size)) zoomratio = float(self.basescale[0]) / old_basescale[0]
zoomratio = float(newside) / oldside
wx.CallLater(200, self.zoom, 0, 0, zoomratio) wx.CallLater(200, self.zoom, 0, 0, zoomratio)
def zoom(self, x, y, factor): def zoom(self, x, y, factor):
......
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