From 6a03015b016c177e0657fc6274a571db16e48b64 Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Sat, 23 Sep 2017 10:02:16 +0200 Subject: Remove unused parameter in SPItem::doWriteTransform --- src/sp-clippath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp-clippath.cpp') diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp index 1829837d8..52c043aee 100644 --- a/src/sp-clippath.cpp +++ b/src/sp-clippath.cpp @@ -310,7 +310,7 @@ const gchar *SPClipPath::create (std::vector &reprs, SPDoc if (NULL != applyTransform) { Geom::Affine transform (item->transform * (*applyTransform)); - item->doWriteTransform(item->getRepr(), transform); + item->doWriteTransform(transform); } } -- cgit v1.2.3 From f81751abb770d0367d6c515cdcb56a7954714eab Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Sat, 23 Sep 2017 10:23:47 +0200 Subject: Transform duplicate object only when clipping or masking --- src/sp-clippath.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/sp-clippath.cpp') diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp index 52c043aee..a56dfd85a 100644 --- a/src/sp-clippath.cpp +++ b/src/sp-clippath.cpp @@ -292,7 +292,7 @@ sp_clippath_view_list_remove(SPClipPathView *list, SPClipPathView *view) } // Create a mask element (using passed elements), add it to -const gchar *SPClipPath::create (std::vector &reprs, SPDocument *document, Geom::Affine const* applyTransform) +const gchar *SPClipPath::create (std::vector &reprs, SPDocument *document) { Inkscape::XML::Node *defsrepr = document->getDefs()->getRepr(); @@ -306,12 +306,7 @@ const gchar *SPClipPath::create (std::vector &reprs, SPDoc for (std::vector::const_iterator it = reprs.begin(); it != reprs.end(); ++it) { Inkscape::XML::Node *node = (*it); - SPItem *item = SP_ITEM(clip_path_object->appendChildRepr(node)); - - if (NULL != applyTransform) { - Geom::Affine transform (item->transform * (*applyTransform)); - item->doWriteTransform(transform); - } + clip_path_object->appendChildRepr(node); } Inkscape::GC::release(repr); -- cgit v1.2.3 From c20891fabc8c3ee2251e0545878e06545b6f0cdd Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 1 Oct 2017 23:57:52 +0200 Subject: First batch --- src/sp-clippath.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/sp-clippath.cpp') diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp index a56dfd85a..d3a3810cb 100644 --- a/src/sp-clippath.cpp +++ b/src/sp-clippath.cpp @@ -126,18 +126,13 @@ void SPClipPath::update(SPCtx* ctx, unsigned int flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; - GSList *l = NULL; + std::vector l; for (auto& child: children) { sp_object_ref(&child); - l = g_slist_prepend(l, &child); + l.push_back(&child); } - l = g_slist_reverse(l); - - while (l) { - SPObject *child = SP_OBJECT(l->data); - l = g_slist_remove(l, child); - + for (auto child:l) { if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { child->updateDisplay(ctx, flags); } @@ -165,22 +160,16 @@ void SPClipPath::modified(unsigned int flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; - GSList *l = NULL; + std::vector l; for (auto& child: children) { sp_object_ref(&child); - l = g_slist_prepend(l, &child); + l.push_back(&child); } - l = g_slist_reverse(l); - - while (l) { - SPObject *child = SP_OBJECT(l->data); - l = g_slist_remove(l, child); - + for (auto child:l) { if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { child->emitModified(flags); } - sp_object_unref(child); } } -- cgit v1.2.3