Skip to content

Commit 9953e4a

Browse files
authored
Merge pull request #2897 from satiowadahc/cw-graphicbugfixs
Correct Typo and Remove redundant loop in gcode graphics
2 parents 7e7cec2 + 9d8d679 commit 9953e4a

1 file changed

Lines changed: 13 additions & 17 deletions

File tree

lib/python/rs274/glcanon.py

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@
1818
from rs274 import Translated, ArcsToSegmentsMixin, OpenGLTk
1919
from OpenGL.GL import *
2020
from OpenGL.GLU import *
21-
import itertools
2221
import math
23-
import glnav
2422
import hershey
2523
import linuxcnc
2624
import array
2725
import gcode
2826
import os
2927
import re
30-
import sys
3128
from functools import reduce
3229

3330
def minmax(*args):
@@ -272,7 +269,7 @@ def tool_offset(self, xo, yo, zo, ao, bo, co, uo, vo, wo):
272269
self.xo = xo
273270
self.yo = yo
274271
self.zo = zo
275-
self.so = ao
272+
self.ao = ao
276273
self.bo = bo
277274
self.co = co
278275
self.uo = uo
@@ -580,21 +577,20 @@ def select(self, x, y):
580577
glMultMatrixd(pmatrix)
581578
glMatrixMode(GL_MODELVIEW)
582579

583-
while 1:
584-
glSelectBuffer(self.select_buffer_size)
585-
glRenderMode(GL_SELECT)
586-
glInitNames()
587-
glPushName(0)
588580

589-
if self.get_show_rapids():
590-
glCallList(self.dlist('select_rapids', gen=self.make_selection_list))
591-
glCallList(self.dlist('select_norapids', gen=self.make_selection_list))
581+
glSelectBuffer(self.select_buffer_size)
582+
glRenderMode(GL_SELECT)
583+
glInitNames()
584+
glPushName(0)
592585

593-
try:
594-
buffer = glRenderMode(GL_RENDER)
595-
except:
596-
buffer = []
597-
break
586+
if self.get_show_rapids():
587+
glCallList(self.dlist('select_rapids', gen=self.make_selection_list))
588+
glCallList(self.dlist('select_norapids', gen=self.make_selection_list))
589+
590+
try:
591+
buffer = glRenderMode(GL_RENDER)
592+
except:
593+
buffer = []
598594

599595
if buffer:
600596
min_depth, max_depth, names = (buffer[0].near, buffer[0].far, buffer[0].names)

0 commit comments

Comments
 (0)