summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-02-21 14:33:56 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-02-27 14:08:02 +0100
commitee6e92b78eee4df8ab06461a3bed1a63c282ff47 (patch)
tree732379154ae2cd47eb17f8bfdf621549886c4620 /source/fitz
parentbcfee39b0ab6de6a5fa223f1e204a35e39a92bb4 (diff)
downloadmupdf-ee6e92b78eee4df8ab06461a3bed1a63c282ff47.tar.xz
Add fz_translate_rect helper function.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/geometry.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/fitz/geometry.c b/source/fitz/geometry.c
index 8bed26a1..688b7046 100644
--- a/source/fitz/geometry.c
+++ b/source/fitz/geometry.c
@@ -464,6 +464,18 @@ fz_union_rect(fz_rect *restrict a, const fz_rect *restrict b)
return a;
}
+fz_rect *
+fz_translate_rect(fz_rect *a, float xoff, float yoff)
+{
+ if (fz_is_empty_rect(a)) return a;
+ if (fz_is_infinite_rect(a)) return a;
+ a->x0 += xoff;
+ a->y0 += yoff;
+ a->x1 += xoff;
+ a->y1 += yoff;
+ return a;
+}
+
fz_irect *
fz_translate_irect(fz_irect *a, int xoff, int yoff)
{