chiark / gitweb /
Small fix for the object cutoff function.
authordaid303 <daid303@gmail.com>
Fri, 15 Feb 2013 10:32:25 +0000 (11:32 +0100)
committerdaid303 <daid303@gmail.com>
Fri, 15 Feb 2013 10:32:25 +0000 (11:32 +0100)
Cura/gui/preview3d.py

index 9c63fa7e38a2746dee424ce21922010d61da7a76..eaf8fd5ac7a445ba8b972294d43c5251963c3b28 100644 (file)
@@ -634,7 +634,7 @@ class PreviewGLCanvas(openglGui.glGuiPanel):
                return self.parent.matrix
 
        def getObjectCenterPos(self):
-               return [self.parent.machineCenter.x, self.parent.machineCenter.y, self.parent.objectsSize[2] / 2]
+               return [self.parent.machineCenter.x, self.parent.machineCenter.y, self.parent.objectsSize[2] / 2 - profile.getProfileSettingFloat('object_sink')]
 
        def OnMouseWheel(self,e):
                self.zoom *= 1.0 - float(e.GetWheelRotation() / e.GetWheelDelta()) / 10.0
@@ -852,7 +852,8 @@ class PreviewGLCanvas(openglGui.glGuiPanel):
                #Draw the current selected tool
                if self.parent.objectsMaxV is not None and self.viewMode != 'GCode' and self.viewMode != 'Mixed':
                        glPushMatrix()
-                       glTranslate(self.parent.machineCenter.x, self.parent.machineCenter.y, self.parent.objectsSize[2]/2)
+                       pos = self.getObjectCenterPos()
+                       glTranslate(pos[0], pos[1], pos[2])
                        self.parent.tool.OnDraw()
                        glPopMatrix()