From e3fe3144bd276bbab4b52aa5d65ac7d487989ff5 Mon Sep 17 00:00:00 2001 From: buliabyak <> Date: Sat, 28 Sep 2013 13:57:04 -0300 Subject: another place where getURI()->toString() values were leaking (bzr r12610) --- src/sp-item.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index a99bf85cc..89e995b5f 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -665,16 +665,20 @@ Inkscape::XML::Node* SPItem::write(Inkscape::XML::Document *xml_doc, Inkscape::X if (item->clip_ref){ if (item->clip_ref->getObject()) { - const gchar *value = g_strdup_printf ("url(%s)", item->clip_ref->getURI()->toString()); + gchar *uri = item->clip_ref->getURI()->toString(); + const gchar *value = g_strdup_printf ("url(%s)", uri); repr->setAttribute ("clip-path", value); g_free ((void *) value); + g_free ((void *) uri); } } if (item->mask_ref){ if (item->mask_ref->getObject()) { - const gchar *value = g_strdup_printf ("url(%s)", item->mask_ref->getURI()->toString()); + gchar *uri = item->mask_ref->getURI()->toString(); + const gchar *value = g_strdup_printf ("url(%s)", uri); repr->setAttribute ("mask", value); g_free ((void *) value); + g_free ((void *) uri); } } -- cgit v1.2.3 From 0c99cd46125045a7e94ae26985e47e1104860b4a Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sat, 28 Sep 2013 18:43:28 -0400 Subject: use geometric bbox to calculate filter effect region (Bug 1229971) Fixed bugs: - https://launchpad.net/bugs/1229971 (bzr r12621) --- src/sp-item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 89e995b5f..c342bfd9b 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -725,7 +725,7 @@ Geom::OptRect SPItem::visualBounds(Geom::Affine const &transform) const // call the subclass method // CPPIFY //bbox = this->bbox(Geom::identity(), SPItem::VISUAL_BBOX); - bbox = const_cast(this)->bbox(Geom::identity(), SPItem::VISUAL_BBOX); + bbox = const_cast(this)->bbox(Geom::identity(), SPItem::GEOMETRIC_BBOX); // see LP Bug 1229971 SPFilter *filter = SP_FILTER(style->getFilter()); // default filer area per the SVG spec: -- cgit v1.2.3 From 87d93e27330577c2fd632dbaccbd3103884aa590 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 1 Oct 2013 15:25:44 +0200 Subject: Comprehensive fix for the issues with disappearing filtered objects. Fixes #304407 and possibly a few other bugs. Revert incorrect _item_bbox changes from r12528. Fixed bugs: - https://launchpad.net/bugs/304407 (bzr r12648) --- src/sp-item.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index c342bfd9b..5bf0afdeb 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -603,13 +603,13 @@ void SPItem::update(SPCtx *ctx, guint flags) { } } } - /* Update bounding box data used by filters */ + /* Update bounding box in user space, used for filter and objectBoundingBox units */ if (item->style->filter.set && item->display) { - Geom::OptRect item_bbox = item->visualBounds(); + Geom::OptRect item_bbox = item->geometricBounds(); SPItemView *itemview = item->display; do { - if (itemview->arenaitem) // Already enlarged by visualBounds - itemview->arenaitem->setFilterBounds(item_bbox); + if (itemview->arenaitem) + itemview->arenaitem->setItemBounds(item_bbox); } while ( (itemview = itemview->next) ); } @@ -1065,12 +1065,8 @@ Inkscape::DrawingItem *SPItem::invoke_show(Inkscape::Drawing &drawing, unsigned SP_MASK(mask)->sp_mask_set_bbox(mask_key, item_bbox); mask->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } - if (style->filter.set && display) { - item_bbox = visualBounds(); - } ai->setData(this); - // Already enlarged by visualBounds for filters - ai->setFilterBounds(item_bbox); + ai->setItemBounds(geometricBounds()); } return ai; -- cgit v1.2.3