diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-04-10 18:16:45 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-04-10 18:19:34 +0100 |
commit | af6f866b0ecd18a797b2a60920ca641892851f9f (patch) | |
tree | 29fa037f6a3255def940b03b58787951f3be8146 | |
parent | b8f786e69e37ca402a2fb35e1eb75839cc4c74d0 (diff) | |
download | mupdf-af6f866b0ecd18a797b2a60920ca641892851f9f.tar.xz |
Don't roll the softmask matrix too early.
Previously we combined the softmask xobject->matrix with the ctm
to make gstate->softmask_ctm at load time. This meant that when
we ran the softmask xobject the xobject->matrix was reapplied a
second time.
The fix is to keep the xobject->matrix out and apply it manually
whereever we use the softmask_ctm (which is just for the bbox
transformation currently).
-rw-r--r-- | pdf/pdf_interpret.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c index 0513c622..2f160eef 100644 --- a/pdf/pdf_interpret.c +++ b/pdf/pdf_interpret.c @@ -335,6 +335,7 @@ pdf_begin_group(pdf_csi *csi, const fz_rect *bbox) fz_rect mask_bbox = softmask->bbox; fz_matrix save_ctm = gstate->ctm; + fz_transform_rect(&mask_bbox, &softmask->matrix); fz_transform_rect(&mask_bbox, &gstate->softmask_ctm); gstate->softmask = NULL; gstate->ctm = gstate->softmask_ctm; @@ -1614,7 +1615,9 @@ pdf_run_extgstate(pdf_csi *csi, pdf_obj *rdb, pdf_obj *extgstate) if (!colorspace) colorspace = fz_device_gray; - fz_concat(&gstate->softmask_ctm, &xobj->matrix, &gstate->ctm); + /* The softmask_ctm no longer has the softmask matrix rolled into it, as this + * causes the softmask matrix to be applied twice. */ + gstate->softmask_ctm = gstate->ctm; gstate->softmask = xobj; for (k = 0; k < colorspace->n; k++) gstate->softmask_bc[k] = 0; |