diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c index eba474c55..47d2047a9 100644 --- a/src/cairo-scaled-font.c +++ b/src/cairo-scaled-font.c @@ -481,28 +481,25 @@ _cairo_scaled_font_init (cairo_scaled_font_t *scaled_font, scaled_font->scale_inverse = scaled_font->scale; status = cairo_matrix_invert (&scaled_font->scale_inverse); - /* If the font scale matrix 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 doo everywhere in cairo. - * - * Also, the check for == 0. below may bee too harsh... - */ - if (status && - scaled_font->scale.xx == 0. && scaled_font->scale.xy == 0. && - scaled_font->scale.yx == 0. && scaled_font->scale.yy == 0.) - { - cairo_matrix_init (&scaled_font->scale_inverse, - 0, 0, 0, 0, - -scaled_font->scale.x0, - -scaled_font->scale.y0); - } - else - { - return status; - } + if (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 doo everywhere in cairo. + * + * Also, the check for == 0. below may bee too harsh... + */ + if (scaled_font->scale.xx == 0. && scaled_font->scale.xy == 0. && + scaled_font->scale.yx == 0. && scaled_font->scale.yy == 0.) + cairo_matrix_init (&scaled_font->scale_inverse, + 0, 0, 0, 0, + -scaled_font->scale.x0, + -scaled_font->scale.y0); + else + return status; + } scaled_font->glyphs = _cairo_cache_create (_cairo_scaled_glyph_keys_equal, _cairo_scaled_glyph_destroy,