From 220b6f3565b8ec6da406acc08e8f09128b7c7346 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 11 Jan 2012 15:31:34 +0100 Subject: Remove fuzzing from fz_round_rect. I don't remember exactly why I added it; but there are several progressions when I remove it. --- fitz/base_geometry.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fitz/base_geometry.c b/fitz/base_geometry.c index 4f9ef8b6..3269605d 100644 --- a/fitz/base_geometry.c +++ b/fitz/base_geometry.c @@ -153,11 +153,10 @@ fz_bbox fz_round_rect(fz_rect f) { fz_bbox i; - /* adjust by 0.001 to compensate for precision errors */ - f.x0 = floorf(f.x0 + 0.001f); - f.y0 = floorf(f.y0 + 0.001f); - f.x1 = ceilf(f.x1 - 0.001f); - f.y1 = ceilf(f.y1 - 0.001f); + f.x0 = floorf(f.x0 + FLT_EPSILON); + f.y0 = floorf(f.y0 + FLT_EPSILON); + f.x1 = ceilf(f.x1 - FLT_EPSILON); + f.y1 = ceilf(f.y1 - FLT_EPSILON); #define SAFE_INT(f) ((f > INT_MAX) ? INT_MAX : ((f < INT_MIN) ? INT_MIN : (int)f)) i.x0 = SAFE_INT(f.x0); i.y0 = SAFE_INT(f.y0); -- cgit v1.2.3