Commit e6eb66ea authored by Guillaume Seguin's avatar Guillaume Seguin

Factorize gviz init by calling clear()

parent c1f315d6
...@@ -178,16 +178,13 @@ class Gviz(wx.Panel): ...@@ -178,16 +178,13 @@ class Gviz(wx.Panel):
self.size = size self.size = size
self.build_dimensions = build_dimensions self.build_dimensions = build_dimensions
self.grid = grid self.grid = grid
self.lastpos = [0, 0, 0, 0, 0, 0, 0]
self.hilightpos = self.lastpos[:]
self.Bind(wx.EVT_PAINT, self.paint) self.Bind(wx.EVT_PAINT, self.paint)
self.Bind(wx.EVT_SIZE, self.resize) self.Bind(wx.EVT_SIZE, self.resize)
self.lines = {} self.hilight = deque()
self.pens = {} self.hilightarcs = deque()
self.arcs = {} self.hilightqueue = Queue(0)
self.arcpens = {} self.hilightarcsqueue = Queue(0)
self.layers = [] self.clear()
self.layerindex = 0
self.filament_width = extrusion_width # set it to 0 to disable scaling lines with zoom self.filament_width = extrusion_width # set it to 0 to disable scaling lines with zoom
self.update_basescale() self.update_basescale()
self.scale = self.basescale self.scale = self.basescale
...@@ -199,12 +196,6 @@ class Gviz(wx.Panel): ...@@ -199,12 +196,6 @@ class Gviz(wx.Panel):
self.hlpen = wx.Pen(wx.Colour(200, 50, 50), penwidth) self.hlpen = wx.Pen(wx.Colour(200, 50, 50), penwidth)
self.fades = [wx.Pen(wx.Colour(250 - 0.6 ** i * 100, 250 - 0.6 ** i * 100, 200 - 0.4 ** i * 50), penwidth) for i in xrange(6)] self.fades = [wx.Pen(wx.Colour(250 - 0.6 ** i * 100, 250 - 0.6 ** i * 100, 200 - 0.4 ** i * 50), penwidth) for i in xrange(6)]
self.penslist = [self.mainpen, self.travelpen, self.hlpen] + self.fades self.penslist = [self.mainpen, self.travelpen, self.hlpen] + self.fades
self.showall = 0
self.hilight = deque()
self.hilightarcs = deque()
self.hilightqueue = Queue(0)
self.hilightarcsqueue = Queue(0)
self.dirty = 1
self.bgcolor = wx.Colour() self.bgcolor = wx.Colour()
self.bgcolor.SetFromName(bgcolor) self.bgcolor.SetFromName(bgcolor)
self.blitmap = wx.EmptyBitmap(self.GetClientSize()[0], self.GetClientSize()[1], -1) self.blitmap = wx.EmptyBitmap(self.GetClientSize()[0], self.GetClientSize()[1], -1)
...@@ -225,6 +216,7 @@ class Gviz(wx.Panel): ...@@ -225,6 +216,7 @@ class Gviz(wx.Panel):
def clear(self): def clear(self):
self.lastpos = [0, 0, 0, 0, 0, 0, 0] self.lastpos = [0, 0, 0, 0, 0, 0, 0]
self.hilightpos = self.lastpos[:]
self.lines = {} self.lines = {}
self.pens = {} self.pens = {}
self.arcs = {} self.arcs = {}
......
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