summaryrefslogtreecommitdiff
path: root/src/pdflib/pdflib/p_xgstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdflib/pdflib/p_xgstate.c')
-rw-r--r--src/pdflib/pdflib/p_xgstate.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/pdflib/pdflib/p_xgstate.c b/src/pdflib/pdflib/p_xgstate.c
index 0e62df9..32acf55 100644
--- a/src/pdflib/pdflib/p_xgstate.c
+++ b/src/pdflib/pdflib/p_xgstate.c
@@ -10,7 +10,7 @@
| |
*---------------------------------------------------------------------------*/
-/* $Id: p_xgstate.c,v 1.1 2008/10/17 06:11:49 scuri Exp $
+/* $Id: p_xgstate.c,v 1.2 2009/10/20 18:14:16 scuri Exp $
*
* Extended graphics state handling
*
@@ -234,13 +234,12 @@ void
pdf_write_page_extgstates(PDF *p)
{
int i, total = 0;
- int bias = p->curr_ppt->eg_bias;
for (i = 0; i < p->extgstates_number; i++)
if (p->extgstates[i].used_on_current_page)
total++;
- if (total > 0 || bias)
+ if (total > 0)
{
pdc_puts(p->out, "/ExtGState");
pdc_begin_dict(p->out);
@@ -253,12 +252,11 @@ pdf_write_page_extgstates(PDF *p)
if (p->extgstates[i].used_on_current_page)
{
p->extgstates[i].used_on_current_page = pdc_false; /* reset */
- pdc_printf(p->out, "/GS%d", bias + i);
+ pdc_printf(p->out, "/GS%d", i);
pdc_objref(p->out, "", p->extgstates[i].obj_id);
}
}
- if (!bias)
pdc_end_dict(p->out);
}
}
@@ -505,10 +503,14 @@ pdf__create_gstate(PDF *p, const char *optlist)
void
pdf__set_gstate(PDF *p, int gstate)
{
- int bias = p->curr_ppt->eg_bias;
+ pdf_extgstateresource *gs;
pdf_check_handle(p, gstate, pdc_gstatehandle);
- pdc_printf(p->out, "/GS%d gs\n", bias + gstate);
+ pdc_printf(p->out, "/GS%d gs\n", gstate);
p->extgstates[gstate].used_on_current_page = pdc_true;
+
+ gs = &p->extgstates[gstate];
+ if (gs->opacity_fill != pdc_undef || gs->opacity_stroke != pdc_undef)
+ pdf_set_autotgroup(p, pdc_true);
}