Skip to content

Commit db761ea

Browse files
committed
qtplasmac: fix table view position for all machine coordinates
1 parent 8b88e0e commit db761ea

2 files changed

Lines changed: 15 additions & 22 deletions

File tree

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '237.308'
1+
VERSION = '237.309'
22
LCNCVER = '2.9'
33
DOCSVER = LCNCVER
44

@@ -2072,26 +2072,14 @@ def view_t_pressed(self):
20722072
QApplication.processEvents()
20732073
self.w.gcodegraphics.set_view('Z')
20742074
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)
20952083
self.w.gcodegraphics.perspective = False
20962084
self.w.gcodegraphics.lat = self.w.gcodegraphics.lon = 0
20972085
self.w.gcodegraphics.updateGL()

share/qtvcp/screens/qtplasmac/versions.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ <h2>QtPlasmaC Version History - LinuxCNC 2.9</h2>
2626
</table>
2727
<br>
2828
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
29+
<br><b><u>237.309 2024 Mar 05</u></b>
30+
<ul style="margin:0;">
31+
<li>fix table view position for all machine coordinates</li>
32+
</ul>
33+
2934
<br><b><u>237.308 2024 Feb 28</u></b>
3035
<ul style="margin:0;">
31-
<li>fix matl overlay for locales that use a comma as a decimal</li>
36+
<li>fix material overlay for locales that use a comma as a decimal</li>
3237
</ul>
3338

3439
<br><b><u>237.307 2024 Feb 25</u></b>

0 commit comments

Comments
 (0)