[cairo-matrix] Move IS_FINITE(det) checks before det==0 checks

I'm still getting floating point exceptions in test suite in a
made-to-overflow test though.  Not sure why isfinite() doesn't work.
This commit is contained in:
Behdad Esfahbod 2008-05-25 00:55:36 -04:00
parent 9827dae570
commit 0621f412ff

View file

@ -490,10 +490,10 @@ cairo_matrix_invert (cairo_matrix_t *matrix)
_cairo_matrix_compute_determinant (matrix, &det);
if (det == 0)
if (! ISFINITE (det))
return _cairo_error (CAIRO_STATUS_INVALID_MATRIX);
if (! ISFINITE (det))
if (det == 0)
return _cairo_error (CAIRO_STATUS_INVALID_MATRIX);
_cairo_matrix_compute_adjoint (matrix);
@ -510,7 +510,7 @@ _cairo_matrix_is_invertible (const cairo_matrix_t *matrix)
_cairo_matrix_compute_determinant (matrix, &det);
return det != 0. && ISFINITE (det);
return ISFINITE (det) && det != 0.;
}
void