=== Bugfix ===

Fix potential problem with Matrix initializer (can't call Matrix_Identity on non square matrices).
This commit is contained in:
2007-05-21 19:41:14 +00:00
parent b1e7c76e93
commit 21bc08a0bb

View File

@@ -952,7 +952,7 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type)
self->matrix[row][col] = mat[(row * colSize) + col]; self->matrix[row][col] = mat[(row * colSize) + col];
} }
} }
} else { /*or if no arguments are passed return identity matrix*/ } else if (rowSize == colSize ) { /*or if no arguments are passed return identity matrix for square matrices */
Matrix_Identity(self); Matrix_Identity(self);
Py_DECREF(self); Py_DECREF(self);
} }