Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2006-02-16 01:31:43 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2006-02-16 01:31:43 +0300
commit9fedbd6c51a5cc9e0799fc0afd3aae3dd9ce699e (patch)
treef673583671684219acd06bd87a997dd0df00a70d /source/blender/python/api2_2x/matrix.c
parent55610ac7c175026d9a6890c42b76a88475176619 (diff)
==Python==
Small bug reported on irc, matrix.translationPart didn't check bounds properly (needed to use || instead of &&). Also fixed similar bugs in rotationPart and rich compare.
Diffstat (limited to 'source/blender/python/api2_2x/matrix.c')
-rw-r--r--source/blender/python/api2_2x/matrix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/matrix.c b/source/blender/python/api2_2x/matrix.c
index fcf0616b874..d3038ddb0bb 100644
--- a/source/blender/python/api2_2x/matrix.c
+++ b/source/blender/python/api2_2x/matrix.c
@@ -154,7 +154,7 @@ PyObject *Matrix_TranslationPart(MatrixObject * self)
{
float vec[4];
- if(self->colSize < 3 && self->rowSize < 4){
+ if(self->colSize < 3 || self->rowSize < 4){
return EXPP_ReturnPyObjError(PyExc_AttributeError,
"Matrix.translationPart: inappropriate matrix size\n");
}
@@ -171,7 +171,7 @@ PyObject *Matrix_RotationPart(MatrixObject * self)
float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
- if(self->colSize < 3 && self->rowSize < 3){
+ if(self->colSize < 3 || self->rowSize < 3){
return EXPP_ReturnPyObjError(PyExc_AttributeError,
"Matrix.rotationPart: inappropriate matrix size\n");
}
@@ -397,7 +397,7 @@ static PyObject* Matrix_richcmpr(PyObject *objectA, PyObject *objectB, int compa
matA = (MatrixObject*)objectA;
matB = (MatrixObject*)objectB;
- if (matA->colSize != matB->colSize && matA->rowSize != matB->rowSize){
+ if (matA->colSize != matB->colSize || matA->rowSize != matB->rowSize){
if (comparison_type == Py_NE){
return EXPP_incr_ret(Py_True);
}else{