summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 079e306)
raw | patch | inline | side by side (parent: 079e306)
author | mental <mental@users.sourceforge.net> | |
Sun, 4 Mar 2007 19:05:50 +0000 (19:05 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Sun, 4 Mar 2007 19:05:50 +0000 (19:05 +0000) |
src/sp-item.cpp | patch | blob | history | |
src/sp-item.h | patch | blob | history |
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 6893c752bedb159efc681df5a6ea526de710f3c7..f94a5e404b2970629d14ccaef471df041bc0e9ef 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
{
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
return NR::Rect(r);
}
+NR::Maybe<NR::Rect> 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)
{
diff --git a/src/sp-item.h b/src/sp-item.h
index 41100060edacf876a0de9d6f714f147da76e955b..5596942763b697693202476c19eea54358a37fdb 100644 (file)
--- a/src/sp-item.h
+++ b/src/sp-item.h
void lowerToBottom();
NR::Rect invokeBbox(NR::Matrix const &transform) const;
- NR::Maybe<NR::Rect> getBBox(BBoxType type, NR::Matrix const &transform, unsigned int dkey=0) const;
+ NR::Maybe<NR::Rect> getBBox(NR::Matrix const &transform, BBoxType type=APPROXIMATE_BBOX, unsigned int dkey=0) const;
sigc::connection _clip_ref_connection;
sigc::connection _mask_ref_connection;