Commit 76818fc0 authored by kliment's avatar kliment

Fix crash on new file load

parent 61af573e
......@@ -23,13 +23,13 @@ class window(wx.Frame):
#print p.lines.keys()
def zoom(self, event):
z=event.GetWheelRotation()
if event.ShiftDown():
if z > 0: self.p.layerdown()
elif z < 0: self.p.layerup()
else:
if z > 0: self.p.zoom(event.GetX(),event.GetY(),1.2)
elif z < 0: self.p.zoom(event.GetX(),event.GetY(),1/1.2)
z=event.GetWheelRotation()
if event.ShiftDown():
if z > 0: self.p.layerdown()
elif z < 0: self.p.layerup()
else:
if z > 0: self.p.zoom(event.GetX(),event.GetY(),1.2)
elif z < 0: self.p.zoom(event.GetX(),event.GetY(),1/1.2)
class gviz(wx.Panel):
def __init__(self,parent,size=(200,200),bedsize=(200,200)):
......@@ -61,10 +61,7 @@ class gviz(wx.Panel):
self.layerindex=0
self.showall=0
self.dirty=1
self.blitmap=wx.EmptyBitmap(self.GetClientSize()[0],self.GetClientSize()[1],-1)
self.repaint()
#self.repaint()
def layerup(self):
if(self.layerindex+1<len(self.layers)):
self.layerindex+=1
......@@ -88,10 +85,10 @@ class gviz(wx.Panel):
def zoom(self,x,y,factor):
self.scale = [s * factor for s in self.scale]
self.translate = [ x - (x-self.translate[0]) * factor,
y - (y-self.translate[1]) * factor]
#self.dirty=1
self.scale = [s * factor for s in self.scale]
self.translate = [ x - (x-self.translate[0]) * factor,
y - (y-self.translate[1]) * factor]
#self.dirty=1
self.repaint()
self.Refresh()
......
......@@ -620,7 +620,7 @@ class pronsole(cmd.Cmd):
def do_sdprint(self,l):
if not self.p.online:
print "Printer is not online. Try connect to it first."
print "Printer is not online. Try connect to it first."
return
self.listing=2
self.sdfiles=[]
......
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