From e302be3ec8aeedc8a13dea67e7e42ed08da31ee0 Mon Sep 17 00:00:00 2001 From: kramm Date: Wed, 26 Mar 2008 13:01:53 +0000 Subject: [PATCH] render multiply blended transparency groups with 50% transparency --- lib/pdf/GFXOutputDev.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index 2537503..2ac6e47 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -2402,10 +2402,14 @@ void GFXOutputDev::paintTransparencyGroup(GfxState *state, double *bbox) } gfxresult_t*grouprecording = states[statepos].grouprecording; - - if(state->getBlendMode() == gfxBlendNormal) { + + int blendmode = state->getBlendMode(); + if(blendmode == gfxBlendNormal || blendmode == gfxBlendMultiply) { + int alpha = state->getFillOpacity()*255; + if(blendmode == gfxBlendMultiply && alpha>200) + alpha = 128; gfxdevice_t ops; - gfxdevice_ops_init(&ops, this->device, (unsigned char)(state->getFillOpacity()*255)); + gfxdevice_ops_init(&ops, this->device, alpha); gfxresult_record_replay(grouprecording, &ops); ops.finish(&ops); } -- 1.7.10.4