mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-08 17:40:40 +01:00
[cairo-scaled-font] Unbreak it after my recent commit
Sigh.
This commit is contained in:
parent
efd3a96524
commit
5dfe47a3f1
1 changed files with 19 additions and 22 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue