Commit 76818fc0 authored by kliment's avatar kliment

Fix crash on new file load

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