From 24fed9639fa23cb59c56515f60c0000e841ab938 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 26 Feb 2018 15:07:20 +0100 Subject: Fix fz_expand_rect in presence of empty rectangles. --- source/fitz/geometry.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/fitz') 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; } -- cgit v1.2.3