index 0e68ae130a368c3013d97c0f56a2bf666f4d55de..988f6126385a1d5f9539abaa8d391d58261e3c1a 100644 (file)
namespace Internal {
CairoRenderer::CairoRenderer(void)
+ : _omitText(false)
{}
CairoRenderer::~CairoRenderer(void)
SPStyle* style = SP_OBJECT_STYLE (item);
Geom::PathVector const & pathv = shape->curve->get_pathvector();
+ if (pathv.empty()) return;
ctx->renderPathVector(pathv, style, &pbox);
void
CairoRenderer::renderItem(CairoRenderContext *ctx, SPItem *item)
{
+ if ( _omitText && (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item)) ) {
+ // skip text if _omitText is true
+ return;
+ }
+
ctx->pushState();
setStateForItem(ctx, item);
bool
CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool pageBoundingBox, SPItem *base)
{
+// PLEASE note when making changes to the boundingbox and transform calculation, corresponding changes should be made to PDFLaTeXRenderer::setupDocument !!!
+
g_assert( ctx != NULL );
if (!base)
@@ -600,8 +609,8 @@ CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool page
NRRect d;
if (pageBoundingBox) {
d.x0 = d.y0 = 0;
- d.x1 = ceil(sp_document_width(doc));
- d.y1 = ceil(sp_document_height(doc));
+ d.x1 = sp_document_width(doc);
+ d.y1 = sp_document_height(doc);
} else {
sp_item_invoke_bbox(base, &d, sp_item_i2d_affine(base), TRUE, SPItem::RENDERING_BBOX);
}
@@ -804,4 +813,4 @@ calculatePreserveAspectRatio(unsigned int aspect_align, unsigned int aspect_clip
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :