summaryrefslogtreecommitdiff
path: root/fitz/base_geometry.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-01-11 15:31:34 +0100
committerTor Andersson <tor.andersson@artifex.com>2012-01-11 16:01:29 +0100
commit220b6f3565b8ec6da406acc08e8f09128b7c7346 (patch)
tree64de28a72978c18d49da2756bb58c73694d7697b /fitz/base_geometry.c
parent02ffa5b15d37cc86964666c78446433f31a15911 (diff)
downloadmupdf-220b6f3565b8ec6da406acc08e8f09128b7c7346.tar.xz
Remove fuzzing from fz_round_rect.
I don't remember exactly why I added it; but there are several progressions when I remove it.
Diffstat (limited to 'fitz/base_geometry.c')
-rw-r--r--fitz/base_geometry.c9
1 files 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);