Purge cairo-test of all calls to round()

Although round() is in the C99 standard, it isn't available in all
toolchains on which cairo is compiled (VC++, for example).
This commit is contained in:
Dan Amelang 2006-12-01 12:46:55 -08:00
parent cb9a3c2640
commit d5fcbfc29f
4 changed files with 8 additions and 8 deletions

View file

@ -76,8 +76,8 @@ draw_glyphs (cairo_t *cr, int x, int y)
cairo_text_extents (cr, "FG", &extents);
cairo_move_to (cr,
x + round ((WIDTH - extents.width) / 2) - extents.x_bearing,
y + round ((HEIGHT - extents.height) / 2) - extents.y_bearing);
x + floor ((WIDTH - extents.width) / 2 + 0.5) - extents.x_bearing,
y + floor ((HEIGHT - extents.height) / 2 + 0.5) - extents.y_bearing);
cairo_show_text (cr, "FG");
}

View file

@ -89,8 +89,8 @@ draw_glyphs (cairo_t *cr, int x, int y)
cairo_text_extents (cr, "FG", &extents);
cairo_move_to (cr,
x + round ((WIDTH - extents.width) / 2) - extents.x_bearing,
y + round ((HEIGHT - extents.height) / 2) - extents.y_bearing);
x + floor ((WIDTH - extents.width) / 2 + 0.5) - extents.x_bearing,
y + floor ((HEIGHT - extents.height) / 2 + 0.5) - extents.y_bearing);
cairo_show_text (cr, "FG");
}

View file

@ -126,8 +126,8 @@ draw_glyphs (cairo_t *cr, int x, int y)
cairo_text_extents (cr, "FG", &extents);
cairo_move_to (cr,
x + round ((WIDTH - extents.width) / 2) - extents.x_bearing,
y + round ((HEIGHT - extents.height) / 2) - extents.y_bearing);
x + floor ((WIDTH - extents.width) / 2 + 0.5) - extents.x_bearing,
y + floor ((HEIGHT - extents.height) / 2 + 0.5) - extents.y_bearing);
cairo_show_text (cr, "FG");
}

View file

@ -75,8 +75,8 @@ draw_glyphs (cairo_t *cr, int x, int y)
cairo_text_extents (cr, "FG", &extents);
cairo_move_to (cr,
x + round ((WIDTH - extents.width) / 2) - extents.x_bearing,
y + round ((HEIGHT - extents.height) / 2) - extents.y_bearing);
x + floor ((WIDTH - extents.width) / 2 + 0.5) - extents.x_bearing,
y + floor ((HEIGHT - extents.height) / 2 + 0.5) - extents.y_bearing);
cairo_show_text (cr, "FG");
}