summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-06-25 11:50:22 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-07-04 17:23:21 +0200
commit7fb50ef76d207ef05d42f6b237bdbbc721fddfe4 (patch)
treeed0c413835bff34b1464dea9f0aa3155e01a1b72 /source/fitz
parent92668c4346480ff4038ecd9ee7beacb688900392 (diff)
downloadmupdf-7fb50ef76d207ef05d42f6b237bdbbc721fddfe4.tar.xz
Add fz_is_point_inside_rect utility function.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/geometry.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/fitz/geometry.c b/source/fitz/geometry.c
index 3857ce35..7cced024 100644
--- a/source/fitz/geometry.c
+++ b/source/fitz/geometry.c
@@ -598,3 +598,13 @@ fz_transform_quad(fz_quad *q, const fz_matrix *m)
fz_transform_point(&q->lr, m);
return q;
}
+
+int fz_is_point_inside_rect(fz_point p, fz_rect r)
+{
+ return (p.x >= r.x0 && p.x < r.x1 && p.y >= r.y0 && p.y < r.y1);
+}
+
+int fz_is_point_inside_irect(int x, int y, fz_irect r)
+{
+ return (x >= r.x0 && x < r.x1 && y >= r.y0 && y < r.y1);
+}