diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2012-02-23 02:19:12 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-03-12 13:28:23 +0000 |
commit | b75dd982f18ce02781ce2a36e630860153f96ec9 (patch) | |
tree | 2f9876888ea13602798685ced91d94e9131a5fd3 /fitz | |
parent | 71e34dd2493b41836db5a9b539ac7ab38e18ddd5 (diff) | |
download | mupdf-b75dd982f18ce02781ce2a36e630860153f96ec9.tar.xz |
Test both coordinates when checking for empty/infinite rect and bboxes.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/fitz.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h index d80204f0..6427537f 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -545,7 +545,7 @@ extern const fz_bbox fz_infinite_bbox; An empty rectangle is defined as one whose area is zero. */ -#define fz_is_empty_rect(r) ((r).x0 == (r).x1) +#define fz_is_empty_rect(r) ((r).x0 == (r).x1 || (r).y0 == (r).y1) /* fz_is_empty_bbox: Check if bounding box is empty. @@ -553,7 +553,7 @@ extern const fz_bbox fz_infinite_bbox; Same definition of empty bounding boxes as for empty rectangles. See fz_is_empty_rect. */ -#define fz_is_empty_bbox(b) ((b).x0 == (b).x1) +#define fz_is_empty_bbox(b) ((b).x0 == (b).x1 || (b).y0 == (b).y1) /* fz_is_infinite: Check if rectangle is infinite. @@ -561,7 +561,7 @@ extern const fz_bbox fz_infinite_bbox; An infinite rectangle is defined as one where either of the two relationships between corner coordinates are not true. */ -#define fz_is_infinite_rect(r) ((r).x0 > (r).x1) +#define fz_is_infinite_rect(r) ((r).x0 > (r).x1 || (r).y0 > (r).y1) /* fz_is_infinite_bbox: Check if bounding box is infinite. @@ -569,7 +569,7 @@ extern const fz_bbox fz_infinite_bbox; Same definition of infinite bounding boxes as for infinite rectangles. See fz_is_infinite_rect. */ -#define fz_is_infinite_bbox(b) ((b).x0 > (b).x1) +#define fz_is_infinite_bbox(b) ((b).x0 > (b).x1 || (b).y0 > (b).y1) /* fz_matrix is a a row-major 3x3 matrix used for representing |