From 360ced76a668588a206d346ed26920ce3113e67f Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sun, 4 Mar 2007 19:05:50 +0000 Subject: implement new API via wrapper for now (bzr r2535) --- src/sp-item.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 6893c752b..f94a5e404 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -634,9 +634,12 @@ sp_item_write(SPObject *const object, Inkscape::XML::Node *repr, guint flags) { SPItem *item = SP_ITEM(object); - gchar *c = sp_svg_transform_write(item->transform); - repr->setAttribute("transform", c); - g_free(c); + gchar c[256]; + if (sp_svg_transform_write(c, 256, item->transform)) { + repr->setAttribute("transform", c); + } else { + repr->setAttribute("transform", NULL); + } SPObject const *const parent = SP_OBJECT_PARENT(object); /** \todo Can someone please document why this is conditional on having @@ -715,6 +718,19 @@ NR::Rect SPItem::invokeBbox(NR::Matrix const &transform) const return NR::Rect(r); } +NR::Maybe SPItem::getBBox(NR::Matrix const &transform, + SPItem::BBoxType type, + unsigned int dkey) const +{ + NRRect r; + sp_item_invoke_bbox_full(this, &r, transform, 0, TRUE); + if (nr_rect_d_test_empty(&r)) { + return NR::Nothing(); + } else { + return NR::Rect(r); + } +} + void sp_item_invoke_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const clear) { -- cgit v1.2.3