diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-11-22 22:18:24 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-12-04 18:55:43 +0000 |
| commit | 4da6c3db24a9370ddefa6b9d26ceb19166d6df92 (patch) | |
| tree | d1179fe485200a31cff586be3c3b36be512971c8 /src/extension/internal/cairo-render-context.cpp | |
| parent | Allow to set INKSCAPE_DATADIR via environment variable (diff) | |
| download | inkscape-4da6c3db24a9370ddefa6b9d26ceb19166d6df92.tar.gz inkscape-4da6c3db24a9370ddefa6b9d26ceb19166d6df92.zip | |
Revert "Fix PDF+TeX output for text inside groups with clip/mask"
This reverts commit e4dea66a338824037b6c35b262aa8db4004b6581.
Diffstat (limited to 'src/extension/internal/cairo-render-context.cpp')
| -rw-r--r-- | src/extension/internal/cairo-render-context.cpp | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 4869472da..791073e90 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -128,8 +128,7 @@ CairoRenderContext::CairoRenderContext(CairoRenderer *parent) : _renderer(parent), _render_mode(RENDER_MODE_NORMAL), _clip_mode(CLIP_MODE_MASK), - _omittext_state(EMPTY), - _omittext_missing_pages(0) + _omittext_state(EMPTY) { } @@ -885,13 +884,6 @@ CairoRenderContext::finish(bool finish_surface) if (_vector_based_target && finish_surface) cairo_show_page(_cr); - // PDF+TeX Output, see CairoRenderContext::_prepareRenderGraphic() - while (_omittext_missing_pages > 0) { - _omittext_missing_pages--; - g_warning("PDF+TeX output: issuing blank PDF page at end (workaround for previous error)"); - cairo_show_page(_cr); - } - cairo_destroy(_cr); _cr = NULL; @@ -1445,29 +1437,8 @@ CairoRenderContext::_prepareRenderGraphic() // Only PDFLaTeX supports importing a single page of a graphics file, // so only PDF backend gets interleaved text/graphics if (_is_omittext && _target == CAIRO_SURFACE_TYPE_PDF) { - if (_omittext_state == NEW_PAGE_ON_GRAPHIC) { - if (cairo_get_group_target(_cr) != cairo_get_target(_cr)) { - // we are in the middle of a group, i. e., between cairo_push_group() and cairo_pop_group(). - // cairo_show_page() has no effect here! - // To ensure that the the generated TeX source doesn't try to include non-existing pages, - // we will later output an extra blank page. - // This is a workaround for bug #1417470. - g_warning("PDF+TeX output: Found text inside a clipped/masked group. This is not supported, the Z-order will be incorrect. Blank pages will be added to the PDF output to work around bug #1417470."); - _omittext_missing_pages++; - } else { - // no group is active, create new page - cairo_show_page(_cr); - // Output missing pages (workaround for the 'if' case above). - // With this solution, the Z-order is more wrong than necessary. - // It would be better to print the blank pages first, and then the actual current page. - // However, this isn't easily possible with cairo. - while (_omittext_missing_pages > 0) { - _omittext_missing_pages--; - g_warning("PDF+TeX output: issuing blank PDF page (workaround for previous error)"); - cairo_show_page(_cr); - } - } - } + if (_omittext_state == NEW_PAGE_ON_GRAPHIC) + cairo_show_page(_cr); _omittext_state = GRAPHIC_ON_TOP; } } |
