summaryrefslogtreecommitdiff
path: root/source/fitz/geometry.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-02-26 15:07:20 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-02-27 14:08:02 +0100
commit24fed9639fa23cb59c56515f60c0000e841ab938 (patch)
treec725df2eb2bd22476f1b37f7ca20f159b189af85 /source/fitz/geometry.c
parent501b6c31f65b3906845dab10edbc8b17627c40c9 (diff)
downloadmupdf-24fed9639fa23cb59c56515f60c0000e841ab938.tar.xz
Fix fz_expand_rect in presence of empty rectangles.
Diffstat (limited to 'source/fitz/geometry.c')
-rw-r--r--source/fitz/geometry.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/fitz/geometry.c b/source/fitz/geometry.c
index 775d442a..4c488669 100644
--- a/source/fitz/geometry.c
+++ b/source/fitz/geometry.c
@@ -546,7 +546,6 @@ fz_expand_irect(fz_irect *a, int expand)
fz_rect *
fz_expand_rect(fz_rect *a, float expand)
{
- if (fz_is_empty_rect(a)) return a;
if (fz_is_infinite_rect(a)) return a;
a->x0 -= expand;
a->y0 -= expand;
@@ -557,11 +556,11 @@ fz_expand_rect(fz_rect *a, float expand)
fz_rect *fz_include_point_in_rect(fz_rect *r, const fz_point *p)
{
+ if (fz_is_infinite_rect(r)) return r;
if (p->x < r->x0) r->x0 = p->x;
if (p->x > r->x1) r->x1 = p->x;
if (p->y < r->y0) r->y0 = p->y;
if (p->y > r->y1) r->y1 = p->y;
-
return r;
}