From fb8e271a03da09112e08031c8a40d7d9ce70bec4 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 14 Oct 2015 16:03:31 +0200 Subject: Fix 696241: fix bracketing of begin_group/end_group for text objects. --- source/pdf/pdf-op-run.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/pdf') diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c index 5fcf2c71..faed37a5 100644 --- a/source/pdf/pdf-op-run.c +++ b/source/pdf/pdf-op-run.c @@ -754,7 +754,8 @@ pdf_flush_text(fz_context *ctx, pdf_run_processor *pr) if (text->len == 0) break; - gstate = pdf_begin_group(ctx, pr, &tb, &softmask); + if (dofill || dostroke) + gstate = pdf_begin_group(ctx, pr, &tb, &softmask); if (doinvisible) fz_ignore_text(ctx, pr->dev, text, &gstate->ctm); @@ -818,6 +819,9 @@ pdf_flush_text(fz_context *ctx, pdf_run_processor *pr) } } + if (dofill || dostroke) + pdf_end_group(ctx, pr, &softmask); + if (doclip) { if (pr->accumulate < 2) @@ -825,8 +829,6 @@ pdf_flush_text(fz_context *ctx, pdf_run_processor *pr) fz_clip_text(ctx, pr->dev, text, &gstate->ctm, pr->accumulate); pr->accumulate = 2; } - - pdf_end_group(ctx, pr, &softmask); } fz_always(ctx) { -- cgit v1.2.3