gsk: Avoid some roundf calls

It seems that gcc has a hard time using intrinsics for round,
so help it out by using floor (x + .5).
This commit is contained in:
Matthias Clasen
2024-03-11 17:39:32 -04:00
parent be3ad1ef99
commit 7283c5c22f
2 changed files with 8 additions and 8 deletions

View File

@@ -53,7 +53,7 @@ gsk_get_scaled_font (PangoFont *font,
FcPattern *pattern;
double dpi;
key = (int) roundf (scale * PANGO_SCALE);
key = (int) floor (scale * PANGO_SCALE + .5);
fonts = (GHashTable *) g_object_get_data (G_OBJECT (font), "gsk-scaled-fonts");
@@ -76,7 +76,7 @@ gsk_get_scaled_font (PangoFont *font,
if (pango_font_description_get_size_is_absolute (desc))
pango_font_description_set_absolute_size (desc, size * scale);
else
pango_font_description_set_size (desc, (int) roundf (size * scale));
pango_font_description_set_size (desc, (int) floor (size * scale + .5));
fontmap = pango_font_get_font_map (font);
context = pango_font_map_create_context (fontmap);