Minor refactor of the snapshot code

This commit is contained in:
cncfanatics
2010-11-19 08:55:10 +01:00
parent 06357db79b
commit cdd463d35b
2 changed files with 8 additions and 8 deletions

View File

@@ -369,19 +369,20 @@ class FittingView(d.Display):
def OnShow(self, event):
if not event.GetShow():
self.Snapshot()
self.MakeSnapshot()
event.Skip()
def CanUseSnapshot(self):
return True
def Snapshot(self):
return self.FVsnapshot
def MakeSnapshot(self):
if self.FVsnapshot:
del self.FVsnapshot
wantedWidth = 0
for i in xrange(4):
wantedWidth += self.GetColumnWidth(i)
rect = self.GetRect()
rect.height = min(rect.height, 400)
rect.width = min(rect.width, wantedWidth)