fix a bug in matrix.invert() for 2x2 matrices
authorRemigiusz Fiedler <migius@gmx.net>
Sat, 1 Nov 2008 11:35:08 +0000 (11:35 +0000)
committerRemigiusz Fiedler <migius@gmx.net>
Sat, 1 Nov 2008 11:35:08 +0000 (11:35 +0000)
reported by Hans in http://blenderartists.org/forum/showthread.php?t=139748

source/blender/python/api2_2x/matrix.c

index 79ca5e09b250fd2402ca5bbefa10edb6b3fb4faf..7802de822cb3fce5ee613dab62811b46a890c6e8 100644 (file)
@@ -246,8 +246,8 @@ PyObject *Matrix_Invert(MatrixObject * self)
                /*calculate the classical adjoint*/
                if(self->rowSize == 2) {
                        mat[0] = self->matrix[1][1];
-                       mat[1] = -self->matrix[1][0];
-                       mat[2] = -self->matrix[0][1];
+                       mat[1] = -self->matrix[0][1];
+                       mat[2] = -self->matrix[1][0];
                        mat[3] = self->matrix[0][0];
                } else if(self->rowSize == 3) {
                        Mat3Adj((float (*)[3]) mat,(float (*)[3]) *self->matrix);