summaryrefslogtreecommitdiff
path: root/platform/gl
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-06-29 17:26:27 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-07-05 15:32:34 +0200
commitf40106ac6b7367292432ee7af61608548d490e8c (patch)
tree3b20165e215e76e3cca40e370e73482d9efdc8fc /platform/gl
parentea7403b4c172338dfe7f371302f82859921e60af (diff)
downloadmupdf-f40106ac6b7367292432ee7af61608548d490e8c.tar.xz
Pass rects by value: device and document interface.
Diffstat (limited to 'platform/gl')
-rw-r--r--platform/gl/gl-annotate.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/platform/gl/gl-annotate.c b/platform/gl/gl-annotate.c
index dca7519a..40e36a31 100644
--- a/platform/gl/gl-annotate.c
+++ b/platform/gl/gl-annotate.c
@@ -68,19 +68,19 @@ static void save_pdf_dialog(void)
}
}
-static int rects_differ(const fz_rect *a, const fz_rect *b, float threshold)
+static int rects_differ(fz_rect a, fz_rect b, float threshold)
{
- if (fz_abs(a->x0 - b->x0) > threshold) return 1;
- if (fz_abs(a->y0 - b->y0) > threshold) return 1;
- if (fz_abs(a->x1 - b->x1) > threshold) return 1;
- if (fz_abs(a->y1 - b->y1) > threshold) return 1;
+ if (fz_abs(a.x0 - b.x0) > threshold) return 1;
+ if (fz_abs(a.y0 - b.y0) > threshold) return 1;
+ if (fz_abs(a.x1 - b.x1) > threshold) return 1;
+ if (fz_abs(a.y1 - b.y1) > threshold) return 1;
return 0;
}
-static int points_differ(const fz_point *a, const fz_point *b, float threshold)
+static int points_differ(fz_point a, fz_point b, float threshold)
{
- if (fz_abs(a->x - b->x) > threshold) return 1;
- if (fz_abs(a->y - b->y) > threshold) return 1;
+ if (fz_abs(a.x - b.x) > threshold) return 1;
+ if (fz_abs(a.y - b.y) > threshold) return 1;
return 0;
}
@@ -836,7 +836,7 @@ static void do_edit_rect(fz_irect canvas_area, fz_irect area, fz_rect *rect)
if (!ui.down)
{
state = ER_NONE;
- if (rects_differ(&start_rect, rect, 1))
+ if (rects_differ(start_rect, *rect, 1))
{
fz_rect trect = fz_transform_rect(*rect, view_page_inv_ctm);
pdf_set_annot_rect(ctx, selected_annot, trect);
@@ -903,7 +903,7 @@ static void do_edit_line(fz_irect canvas_area, fz_irect area, fz_rect *rect)
if (!ui.down)
{
state = EL_NONE;
- if (points_differ(&start_a, &a, 1) || points_differ(&start_b, &b, 1))
+ if (points_differ(start_a, a, 1) || points_differ(start_b, b, 1))
{
a = fz_transform_point(a, view_page_inv_ctm);
b = fz_transform_point(b, view_page_inv_ctm);