From 3e075e587aaa712efb1704478cd1a75131882889 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Mon, 2 Oct 2017 23:30:11 +0200 Subject: third batch --- src/sp-filter.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/sp-filter.cpp') diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp index 052fa7fe2..2a5ec0755 100644 --- a/src/sp-filter.cpp +++ b/src/sp-filter.cpp @@ -267,19 +267,18 @@ Inkscape::XML::Node* SPFilter::write(Inkscape::XML::Document *doc, Inkscape::XML repr = doc->createElement("svg:filter"); } - GSList *l = NULL; + std::vector l; for (auto& child: children) { Inkscape::XML::Node *crepr = child.updateRepr(doc, NULL, flags); if (crepr) { - l = g_slist_prepend (l, crepr); + l.push_back(crepr); } } - while (l) { - repr->addChild((Inkscape::XML::Node *) l->data, NULL); - Inkscape::GC::release((Inkscape::XML::Node *) l->data); - l = g_slist_remove (l, l->data); + for (auto i=l.rbegin();i!=l.rend();++i) { + repr->addChild(*i, NULL); + Inkscape::GC::release(*i); } } else { for (auto& child: children) { -- cgit v1.2.3 From b4b96eb22c978024da8841f9184b1c7d85140ffd Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Thu, 5 Oct 2017 18:34:42 +0300 Subject: Extract SPDimensions from spfilters --- src/sp-filter.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src/sp-filter.cpp') diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp index 2a5ec0755..aa5fe2942 100644 --- a/src/sp-filter.cpp +++ b/src/sp-filter.cpp @@ -213,25 +213,7 @@ void SPFilter::update(SPCtx *ctx, guint flags) { // Note: This only works for root viewport since this routine is not called after // setting a new viewport. A true fix requires a strategy like SPItemView or SPMarkerView. if(this->filterUnits == SP_FILTER_UNITS_USERSPACEONUSE) { - if (this->x.unit == SVGLength::PERCENT) { - this->x._set = true; - this->x.computed = this->x.value * ictx->viewport.width(); - } - - if (this->y.unit == SVGLength::PERCENT) { - this->y._set = true; - this->y.computed = this->y.value * ictx->viewport.height(); - } - - if (this->width.unit == SVGLength::PERCENT) { - this->width._set = true; - this->width.computed = this->width.value * ictx->viewport.width(); - } - - if (this->height.unit == SVGLength::PERCENT) { - this->height._set = true; - this->height.computed = this->height.value * ictx->viewport.height(); - } + this->calcDimsFromParentViewport(ictx, true); } /* do something to trigger redisplay, updates? */ -- cgit v1.2.3