Commit d3b8e1ff authored by D1plo1d's avatar D1plo1d

Merge branch 'experimental' of github.com:kliment/Printrun into experimental

parents 828eef1a 727f9f0a
...@@ -383,7 +383,7 @@ class GCode(object): ...@@ -383,7 +383,7 @@ class GCode(object):
currenttravel = math.hypot(x - lastx, y - lasty) currenttravel = math.hypot(x - lastx, y - lasty)
if f == lastf: # Feedrate hasn't changed, no acceleration/decceleration planned if f == lastf: # Feedrate hasn't changed, no acceleration/decceleration planned
moveduration = currenttravel / f moveduration = currenttravel / f if f != 0 else 0.
else: else:
# FIXME: review this better # FIXME: review this better
# this looks wrong : there's little chance that the feedrate we'll decelerate to is the previous feedrate # this looks wrong : there's little chance that the feedrate we'll decelerate to is the previous feedrate
......
...@@ -43,6 +43,7 @@ class wxGLPanel(wx.Panel): ...@@ -43,6 +43,7 @@ class wxGLPanel(wx.Panel):
super(wxGLPanel, self).__init__(parent, id, pos, size, style) super(wxGLPanel, self).__init__(parent, id, pos, size, style)
self.GLinitialized = False self.GLinitialized = False
self.mview_initialized = False
attribList = (glcanvas.WX_GL_RGBA, # RGBA attribList = (glcanvas.WX_GL_RGBA, # RGBA
glcanvas.WX_GL_DOUBLEBUFFER, # Double Buffered glcanvas.WX_GL_DOUBLEBUFFER, # Double Buffered
glcanvas.WX_GL_DEPTH_SIZE, 24) # 24 bit glcanvas.WX_GL_DEPTH_SIZE, 24) # 24 bit
...@@ -126,7 +127,9 @@ class wxGLPanel(wx.Panel): ...@@ -126,7 +127,9 @@ class wxGLPanel(wx.Panel):
else: else:
gluPerspective(60., float(width) / height, 10.0, 3 * self.dist) gluPerspective(60., float(width) / height, 10.0, 3 * self.dist)
self.reset_mview(0.9) if not self.mview_initialized:
self.reset_mview(0.9)
self.mview_initialized = True
# Wrap text to the width of the window # Wrap text to the width of the window
if self.GLinitialized: if self.GLinitialized:
...@@ -341,9 +344,9 @@ class GcodeViewPanel(wxGLPanel): ...@@ -341,9 +344,9 @@ class GcodeViewPanel(wxGLPanel):
self.handle_rotation(event) self.handle_rotation(event)
elif event.Dragging() and event.RightIsDown(): elif event.Dragging() and event.RightIsDown():
self.handle_translation(event) self.handle_translation(event)
elif event.ButtonUp(wx.MOUSE_BTN_LEFT): elif event.LeftUp():
self.initpos = None self.initpos = None
elif event.ButtonUp(wx.MOUSE_BTN_RIGHT): elif event.RightUp():
self.initpos = None self.initpos = None
else: else:
event.Skip() event.Skip()
......
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