summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-annot-edit.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-02-27 14:20:36 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-02-27 17:47:54 +0100
commit8ebca3d5481961f56b5754ab4cfa9544f58c5b0b (patch)
tree63ba1f4a7f228234eb4fd6cf13f682a653519076 /source/pdf/pdf-annot-edit.c
parentce03adbff727cfad99e7103068b73f7782cbc9f7 (diff)
downloadmupdf-8ebca3d5481961f56b5754ab4cfa9544f58c5b0b.tar.xz
Use fz_point for pdf_set_annot_ink_list and vertices too.
Diffstat (limited to 'source/pdf/pdf-annot-edit.c')
-rw-r--r--source/pdf/pdf-annot-edit.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c
index 20cc8edd..15541d45 100644
--- a/source/pdf/pdf-annot-edit.c
+++ b/source/pdf/pdf-annot-edit.c
@@ -720,7 +720,7 @@ pdf_annot_vertex(fz_context *ctx, pdf_annot *annot, int i)
}
void
-pdf_set_annot_vertices(fz_context *ctx, pdf_annot *annot, int n, const float *v)
+pdf_set_annot_vertices(fz_context *ctx, pdf_annot *annot, int n, const fz_point *v)
{
pdf_document *doc = annot->page->doc;
fz_matrix page_ctm, inv_page_ctm;
@@ -738,8 +738,7 @@ pdf_set_annot_vertices(fz_context *ctx, pdf_annot *annot, int n, const float *v)
vertices = pdf_new_array(ctx, doc, n * 2);
for (i = 0; i < n; ++i)
{
- point.x = v[i * 2];
- point.y = v[i * 2 + 1];
+ point = v[i];
fz_transform_point(&point, &inv_page_ctm);
pdf_array_push_drop(ctx, vertices, pdf_new_real(ctx, doc, point.x));
pdf_array_push_drop(ctx, vertices, pdf_new_real(ctx, doc, point.y));
@@ -974,7 +973,7 @@ pdf_annot_ink_list_stroke_vertex(fz_context *ctx, pdf_annot *annot, int i, int k
}
void
-pdf_set_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, const int *count, const float *v)
+pdf_set_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, const int *count, const fz_point *v)
{
pdf_document *doc = annot->page->doc;
fz_matrix page_ctm, inv_page_ctm;
@@ -992,11 +991,10 @@ pdf_set_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, const int *coun
ink_list = pdf_new_array(ctx, doc, n);
for (i = 0; i < n; ++i)
{
- stroke = pdf_new_array(ctx, doc, count[i]);
+ stroke = pdf_new_array(ctx, doc, count[i] * 2);
for (k = 0; k < count[i]; ++k)
{
- point.x = *v++;
- point.y = *v++;
+ point = *v++;
fz_transform_point(&point, &inv_page_ctm);
pdf_array_push_drop(ctx, stroke, pdf_new_real(ctx, doc, point.x));
pdf_array_push_drop(ctx, stroke, pdf_new_real(ctx, doc, point.y));