Commit a011b345 authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Fixed bug in functions.invertQTransform -- incorrectly checked for scipy.weave...

Fixed bug in functions.invertQTransform -- incorrectly checked for scipy.weave instead of scipy.linalg
parent 1d05656a
......@@ -1376,10 +1376,11 @@ def invertQTransform(tr):
bugs in that method. (specifically, Qt has floating-point precision issues
when determining whether a matrix is invertible)
"""
if not USE_WEAVE:
raise Exception("This function depends on scipy.weave library, but it does not appear to be usable.")
#return tr.inverted()[0]
if not HAVE_SCIPY:
inv = tr.inverted()
if inv[1] is False:
raise Exception("Transform is not invertible.")
return inv[0]
arr = np.array([[tr.m11(), tr.m12(), tr.m13()], [tr.m21(), tr.m22(), tr.m23()], [tr.m31(), tr.m32(), tr.m33()]])
inv = scipy.linalg.inv(arr)
return QtGui.QTransform(inv[0,0], inv[0,1], inv[0,2], inv[1,0], inv[1,1], inv[1,2], inv[2,0], inv[2,1])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment