diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-05-08 17:36:01 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-05-15 21:31:02 +0100 |
commit | 669e7ae5c98812360bf20b798c20024ae2e9810b (patch) | |
tree | caf2b733a80c626599c2f268e715de602954e4c2 | |
parent | fe7410c6cdc19bb366bf1e93481bf8287a14d52e (diff) |
[test] Relax APPROX_EQUALS condition
The bounding box of the text is rounded to the nearest pixel boundaries,
so therefore the test must accept a similar level of imprecision.
-rw-r--r-- | test/get-path-extents.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/get-path-extents.c b/test/get-path-extents.c index 96fdfccd..337dad2d 100644 --- a/test/get-path-extents.c +++ b/test/get-path-extents.c @@ -74,10 +74,10 @@ check_extents (const cairo_test_context_t *ctx, break; case APPROX_EQUALS: relation_string = "approx. equal"; - if (floor (ext_x1 + 0.5) == floor (x + 0.5) && - floor (ext_y1 + 0.5) == floor (y + 0.5) && - floor (ext_x2 + 0.5) == floor (x + width + 0.5) && - floor (ext_y2 + 0.5) == floor (y + height + 0.5)) + if (fabs (ext_x1 - x) < 1. && + fabs (ext_y1 - y) < 1. && + fabs (ext_x2 - (x + width)) < 1. && + fabs (ext_y2 - (y + height)) < 1.) { return 1; } |