|
1 | | -VERSION = '237.308' |
| 1 | +VERSION = '237.309' |
2 | 2 | LCNCVER = '2.9' |
3 | 3 | DOCSVER = LCNCVER |
4 | 4 |
|
@@ -2072,26 +2072,14 @@ def view_t_pressed(self): |
2072 | 2072 | QApplication.processEvents() |
2073 | 2073 | self.w.gcodegraphics.set_view('Z') |
2074 | 2074 | mid, size = DRAW.extents_info(self.w.gcodegraphics) |
2075 | | - if self.gcodeProps: |
2076 | | - mult = 1 |
2077 | | - if self.units == 'in' and self.gcodeProps['gcode_units'] == 'mm': |
2078 | | - mult = 0.03937 |
2079 | | - elif self.units == 'mm' and self.gcodeProps['gcode_units'] == 'in': |
2080 | | - mult = 25.4 |
2081 | | - x = (round(float(self.gcodeProps['x'].split()[0]) * mult, 4)) |
2082 | | - y = (round(float(self.gcodeProps['y'].split()[0]) * mult, 4)) |
2083 | | - xl = (round(float(self.gcodeProps['x'].split('=')[1].split()[0]) * mult, 4)) |
2084 | | - yl = (round(float(self.gcodeProps['y'].split('=')[1].split()[0]) * mult, 4)) |
2085 | | - else: |
2086 | | - x = y = xl = yl = 0 |
2087 | | - if (mid[0] == 0 and mid[1] == 0) or mid[0] > self.xLen or mid[1] > self.yLen or \ |
2088 | | - self.w.view_t.isChecked() or self.w.view_t.isDown() or self.fileClear: |
2089 | | - mult = 1 if self.units == 'in' else 25.4 |
2090 | | - zoomScale = (self.w.table_zoom_scale.value() * 2) |
2091 | | - mid = [(self.xLen - (x * 2) - xl) / mult / 2, (self.yLen - (y * 2) - yl) / mult / 2, 0] |
2092 | | - size = [self.xLen / mult / zoomScale, self.yLen / mult / zoomScale, 0] |
2093 | | - glTranslatef(-mid[0], -mid[1], -mid[2]) |
2094 | | - self.w.gcodegraphics.set_eyepoint_from_extents(size[0], size[1]) |
| 2075 | + mult = 1 if self.units == 'in' else 25.4 |
| 2076 | + zoomScale = (self.w.table_zoom_scale.value() * 2) |
| 2077 | + xTableCenter = (self.xMin + self.xLen / 2) / mult - mid[0] |
| 2078 | + yTableCenter = (self.yMin + self.yLen / 2) / mult - mid[1] |
| 2079 | + xSize = self.xLen / mult / zoomScale |
| 2080 | + ySize = self.yLen / mult / zoomScale |
| 2081 | + glTranslatef(-xTableCenter, -yTableCenter, 0) |
| 2082 | + self.w.gcodegraphics.set_eyepoint_from_extents(xSize, ySize) |
2095 | 2083 | self.w.gcodegraphics.perspective = False |
2096 | 2084 | self.w.gcodegraphics.lat = self.w.gcodegraphics.lon = 0 |
2097 | 2085 | self.w.gcodegraphics.updateGL() |
|
0 commit comments