Skip to content

Commit 74b41ce

Browse files
committed
add try for gluUnProject exception seen with 3.1.6 on MacOS (#182)
1 parent 120fb10 commit 74b41ce

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

GSASII/GSASIIplot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5814,7 +5814,11 @@ def SetCursorStatus(newxy,contours=False):
58145814
View = GL.glGetIntegerv(GL.GL_VIEWPORT)
58155815
Tx,Ty,Tz = drawingData['viewPoint'][0]
58165816
tx,ty,tz = GLU.gluProject(Tx,Ty,Tz)
5817-
Cx,Cy,Cz = GLU.gluUnProject(newxy[0],View[3]-newxy[1],tz)
5817+
try:
5818+
Cx,Cy,Cz = GLU.gluUnProject(newxy[0],View[3]-newxy[1],tz)
5819+
except: # not sure why this happens, pyOpenGL 3.1.6 bug on MacOS? (3.1.9 OK)
5820+
G2frame.G2plotNB.status.SetStatusText('Cursor position calc failed',1)
5821+
return
58185822
rho = G2mth.getRho([Cx,Cy,Cz],mapData)
58195823
if contours:
58205824
try:

0 commit comments

Comments
 (0)