summaryrefslogtreecommitdiff
path: root/src/cairo-matrix.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2005-01-19 12:12:42 +0000
committerCarl Worth <cworth@cworth.org>2005-01-19 12:12:42 +0000
commit68d5ba661d5d0ba0a604a3c947f43f629a6a6bb9 (patch)
treeae1affc5f96f8cd1b8f70401fdd0efd26457afd6 /src/cairo-matrix.c
parent429c1f42b5942ebd8b3170e462418880c7cf5e2e (diff)
Allow NULL values for return pointers so that the user can easily get partial results from cairo_matrix_get_affine, cairo_current_point, and cairo_current_color_rgb as needed.
Diffstat (limited to 'src/cairo-matrix.c')
-rw-r--r--src/cairo-matrix.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/cairo-matrix.c b/src/cairo-matrix.c
index 46702471..b964b688 100644
--- a/src/cairo-matrix.c
+++ b/src/cairo-matrix.c
@@ -125,9 +125,20 @@ cairo_matrix_get_affine (cairo_matrix_t *matrix,
double *c, double *d,
double *tx, double *ty)
{
- *a = matrix->m[0][0]; *b = matrix->m[0][1];
- *c = matrix->m[1][0]; *d = matrix->m[1][1];
- *tx = matrix->m[2][0]; *ty = matrix->m[2][1];
+ if (a)
+ *a = matrix->m[0][0];
+ if (b)
+ *b = matrix->m[0][1];
+
+ if (c)
+ *c = matrix->m[1][0];
+ if (d)
+ *d = matrix->m[1][1];
+
+ if (tx)
+ *tx = matrix->m[2][0];
+ if (ty)
+ *ty = matrix->m[2][1];
return CAIRO_STATUS_SUCCESS;
}