summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2014-07-18 22:15:12 +0200
committerTor Andersson <tor.andersson@artifex.com>2014-08-19 17:09:11 +0200
commita27c538cc3262377166251c73c9b09ff7f67192b (patch)
tree6fd8c99dd2d244f5a751c6ae144f533a4555c816 /source/fitz
parentdac6ec31abd2a4e19f1bee26b95bcbb508522bf1 (diff)
downloadmupdf-a27c538cc3262377166251c73c9b09ff7f67192b.tar.xz
don't render non-empty dashing with zero-length phase
Adobe Reader and Microsoft XPS viewer differ in their handling of non-empty dashed strokes where the phase is 0: Adobe Reader considers these to be faulty and omits them while Microsoft XPS Viewer renders them the same as an empty dash (i.e. solid). This patch makes Fitz no longer render such strokes and ensures that MuXPS never emits them so that the desired behavior results (this is the easier implementation since XPS rendering code renders stroked paths in a single location whereas PDF rendering does it all over the place). See https://code.google.com/p/sumatrapdf/issues/detail?id=2339 for a testcase.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/draw-path.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/fitz/draw-path.c b/source/fitz/draw-path.c
index b1bcb11b..d184fad2 100644
--- a/source/fitz/draw-path.c
+++ b/source/fitz/draw-path.c
@@ -980,6 +980,8 @@ fz_flatten_dash_path(fz_gel *gel, fz_path *path, const fz_stroke_state *stroke,
phase_len = 0;
for (i = 0; i < stroke->dash_len; i++)
phase_len += stroke->dash_list[i];
+ if (stroke->dash_len > 0 && phase_len == 0)
+ return;
fz_gel_scissor(gel, &s.rect);
if (fz_try_invert_matrix(&inv, ctm))
return;