Skip to content

Commit

Permalink
Purge cairo-test of all calls to round()
Browse files Browse the repository at this point in the history
Although round() is in the C99 standard, it isn't available in all
toolchains on which cairo is compiled (VC++, for example).
  • Loading branch information
Dan Amelang committed Dec 1, 2006
1 parent cb9a3c2 commit d5fcbfc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/clip-operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
4 changes: 2 additions & 2 deletions test/operator-clear.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
4 changes: 2 additions & 2 deletions test/operator-source.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
4 changes: 2 additions & 2 deletions test/unbounded-operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down

0 comments on commit d5fcbfc

Please sign in to comment.