diff options
author | Paul Gardiner <paulg.artifex@glidos.net> | 2013-06-14 11:08:39 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-06-17 15:07:08 +0100 |
commit | b695c87abcdbe0ddc35c5e3a7ee8f5f58ee577f1 (patch) | |
tree | 31a470c889c88540235d4f70b6e1334249b92fbe /pdf | |
parent | e860f7240878c22d90b086827e58e1e8e055bbf8 (diff) | |
download | mupdf-b695c87abcdbe0ddc35c5e3a7ee8f5f58ee577f1.tar.xz |
Tweaks to ink annotation for smoothness.
Patch from "andyhan2000" to make the ink annotations smoother.
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdf_annot.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pdf/pdf_annot.c b/pdf/pdf_annot.c index ad89725b..37c89902 100644 --- a/pdf/pdf_annot.c +++ b/pdf/pdf_annot.c @@ -1141,6 +1141,7 @@ pdf_set_ink_obj_appearance(pdf_document *doc, pdf_obj *annot) for (i = 0; i < n; i ++) { + fz_point pt_last; pdf_obj *arc = pdf_array_get(list, i); m = pdf_array_len(arc); @@ -1163,8 +1164,10 @@ pdf_set_ink_obj_appearance(pdf_document *doc, pdf_obj *annot) if (j == 0) fz_moveto(ctx, path, pt.x, pt.y); else - fz_lineto(ctx, path, pt.x, pt.y); + fz_curvetov(ctx, path, pt_last.x, pt_last.y, (pt.x + pt_last.x) / 2, (pt.y + pt_last.y) / 2); + pt_last = pt; } + fz_lineto(ctx, path, pt_last.x, pt_last.y); } fz_stroke_path(dev, path, stroke, &fz_identity, cs, color, 1.0f); |