diff options
author | Andrew Hale <TrumanBlending@gmail.com> | 2012-02-01 05:42:36 +0400 |
---|---|---|
committer | Andrew Hale <TrumanBlending@gmail.com> | 2012-02-01 05:42:36 +0400 |
commit | 40f1686f476c4b8b2b4f143281bf16df96ed4321 (patch) | |
tree | 3b6c02ef847faf4cc49b6229e2d982cd80136491 /source/blender/python | |
parent | 4fd4a2e7b92c68c3770fe2d0bbfa4e6a1cef9d77 (diff) |
Fixes to Python matrices str function.
1) The width of columns was incorrectly determined on windows, fixed by increasing the size of the dummy buf.
2) Added additional brackets to string for consistent formatting
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Matrix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index efd73bf8c04..9171be13ffc 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -1562,7 +1562,7 @@ static PyObject *Matrix_str(MatrixObject *self) int maxsize[MATRIX_MAX_DIM]; int row, col; - char dummy_buf[1]; + char dummy_buf[64]; if (BaseMath_ReadCallback(self) == -1) return NULL; @@ -1584,7 +1584,7 @@ static PyObject *Matrix_str(MatrixObject *self) for (col = 0; col < self->num_col; col++) { BLI_dynstr_appendf(ds, col ? ", %*.4f" : "%*.4f", maxsize[col], MATRIX_ITEM(self, row, col)); } - BLI_dynstr_append(ds, row + 1 != self->num_row ? ")\n " : ")"); + BLI_dynstr_append(ds, row + 1 != self->num_row ? ")\n (" : ")"); } BLI_dynstr_append(ds, ">"); |