diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-05-09 15:13:46 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-05-09 15:18:39 +0200 |
commit | 934c511da4d3585631b4a32a81a16228202f9ec7 (patch) | |
tree | 42a69643ea1e7c2b293fe6951af739315c88a817 | |
parent | b72cf33e3681bdcd488fa5a580466e28766475fb (diff) | |
download | mupdf-934c511da4d3585631b4a32a81a16228202f9ec7.tar.xz |
Fix 699319: Apply clip path after drawing, not before.
-rw-r--r-- | source/pdf/pdf-op-run.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c index 080452a8..8ef1943a 100644 --- a/source/pdf/pdf-op-run.c +++ b/source/pdf/pdf-op-run.c @@ -633,13 +633,6 @@ pdf_show_path(fz_context *ctx, pdf_run_processor *pr, int doclose, int dofill, i fz_bound_path(ctx, path, (dostroke ? gstate->stroke_state : NULL), &gstate->ctm, &bbox); - if (pr->clip) - { - gstate->clip_depth++; - fz_clip_path(ctx, pr->dev, path, pr->clip_even_odd, &gstate->ctm, &bbox); - pr->clip = 0; - } - if (pr->super.hidden) dostroke = dofill = 0; @@ -728,6 +721,14 @@ pdf_show_path(fz_context *ctx, pdf_run_processor *pr, int doclose, int dofill, i if (dofill || dostroke) pdf_end_group(ctx, pr, &softmask); + + if (pr->clip) + { + gstate = pr->gstate + pr->gtop; /* in case it was changed by pdf_begin_group */ + gstate->clip_depth++; + fz_clip_path(ctx, pr->dev, path, pr->clip_even_odd, &gstate->ctm, &bbox); + pr->clip = 0; + } } fz_always(ctx) { |