diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-01 23:22:31 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-01 23:22:31 +0100 |
commit | ca72b372237287af0f4475801a9b64efca975832 (patch) | |
tree | 90748c67c35567ea9341b90031257171883346aa /src/sna/sna_transform.c | |
parent | b83e2a79f2a082630e0d3147abec8d3599f3f4b4 (diff) |
sna: Drop return value from 3D point transform
And just fixup the computed coordinates in the face of an invalid
matrix.
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_transform.c')
-rw-r--r-- | src/sna/sna_transform.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/sna/sna_transform.c b/src/sna/sna_transform.c index 644d4045..54852b1f 100644 --- a/src/sna/sna_transform.c +++ b/src/sna/sna_transform.c @@ -114,7 +114,7 @@ sna_get_transformed_coordinates(int x, int y, /** * Returns the un-normalized floating-point coordinates transformed by the given transform. */ -Bool +void sna_get_transformed_coordinates_3d(int x, int y, const PictTransform *transform, float *x_out, float *y_out, float *w_out) @@ -126,13 +126,13 @@ sna_get_transformed_coordinates_3d(int x, int y, } else { int64_t result[3]; - if (!_sna_transform_point(transform, x, y, result)) - return FALSE; - - *x_out = result[0] / 65536.; - *y_out = result[1] / 65536.; - *w_out = result[2] / 65536.; + if (_sna_transform_point(transform, x, y, result)) { + *x_out = result[0] / 65536.; + *y_out = result[1] / 65536.; + *w_out = result[2] / 65536.; + } else { + *x_out = *y_out = 0; + *w_out = 1.; + } } - - return TRUE; } |