summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-annot.c
diff options
context:
space:
mode:
authorPaul Gardiner <paul.gardiner@artifex.com>2013-11-05 16:48:13 +0000
committerPaul Gardiner <paul.gardiner@artifex.com>2013-11-05 16:48:13 +0000
commit2901c7d78c9880b6fda7ccf9b000d847724071e4 (patch)
treecf287dc755a822f1e3a34e85cf32595d4d9ea995 /source/pdf/pdf-annot.c
parent1dd2a1ae1f1cb7d93ec2edcc5a6c7e7fd4f0e2ec (diff)
downloadmupdf-2901c7d78c9880b6fda7ccf9b000d847724071e4.tar.xz
Fix bug 694730: Wrong bbox in one-point ink annotation
Zero and one-point case both lead to an empty rectangle, but the one-point case needs expanding but wasn't because fz_expand_rect treats an empty rectangle as a special case (as it should)
Diffstat (limited to 'source/pdf/pdf-annot.c')
-rw-r--r--source/pdf/pdf-annot.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/pdf/pdf-annot.c b/source/pdf/pdf-annot.c
index 21cc00cc..338ca1ac 100644
--- a/source/pdf/pdf-annot.c
+++ b/source/pdf/pdf-annot.c
@@ -920,7 +920,19 @@ pdf_set_ink_annot_list(pdf_document *doc, pdf_annot *annot, fz_point *pts, int *
}
}
- fz_expand_rect(&rect, thickness);
+ /*
+ Expand the rectangle by thickness all around. We cannot use
+ fz_expand_rect because the rectangle might be empty in the
+ single point case
+ */
+ if (k > 0)
+ {
+ rect.x0 -= thickness;
+ rect.y0 -= thickness;
+ rect.x1 += thickness;
+ rect.y1 += thickness;
+ }
+
pdf_dict_puts_drop(annot->obj, "Rect", pdf_new_rect(doc, &rect));
update_rect(ctx, annot);