[cairo-commit] src/cairo-gstate.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri Feb 4 12:45:10 PST 2011


 src/cairo-gstate.c |    3 ---
 1 file changed, 3 deletions(-)

New commits:
commit fc8c54dafe8e607053523e80447507fb57bc0fc0
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Feb 4 15:43:40 2011 -0500

    Don't err on non-invertible font matrix
    
    The scaled-font layer handles that later if it actually is a problem:
    
        scaled_font->scale_inverse = scaled_font->scale;
        status = cairo_matrix_invert (&scaled_font->scale_inverse);
        if (unlikely (status)) {
            /* If the font scale matrix is rank 0, just using an all-zero inverse matrix
             * makes everything work correctly.  This make font size 0 work without
             * producing an error.
             *
             * FIXME:  If the scale is rank 1, we still go into error mode.  But then
             * again, that's what we do everywhere in cairo.
             *
             * Also, the check for == 0. below may be too harsh...
             */
            if (_cairo_matrix_is_scale_0 (&scaled_font->scale)) {
                cairo_matrix_init (&scaled_font->scale_inverse,
                                   0, 0, 0, 0,
                                   -scaled_font->scale.x0,
                                   -scaled_font->scale.y0);
            } else
                return status;
        }

diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index 7298a7f..c604482 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -1622,9 +1622,6 @@ _cairo_gstate_set_font_matrix (cairo_gstate_t	    *gstate,
     if (memcmp (matrix, &gstate->font_matrix, sizeof (cairo_matrix_t)) == 0)
 	return CAIRO_STATUS_SUCCESS;
 
-    if (! _cairo_matrix_is_invertible (matrix))
-	return _cairo_error (CAIRO_STATUS_INVALID_MATRIX);
-
     _cairo_gstate_unset_scaled_font (gstate);
 
     gstate->font_matrix = *matrix;


More information about the cairo-commit mailing list