diff options
Diffstat (limited to 'fitz/base_geometry.c')
-rw-r--r-- | fitz/base_geometry.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fitz/base_geometry.c b/fitz/base_geometry.c index 378fd266..7f589ff5 100644 --- a/fitz/base_geometry.c +++ b/fitz/base_geometry.c @@ -459,3 +459,13 @@ fz_expand_rect(fz_rect *a, float expand) a->y1 += expand; return a; } + +fz_rect *fz_include_point_in_rect(fz_rect *r, const fz_point *p) +{ + 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; +}
\ No newline at end of file |