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-use.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/sp-use.cpp') diff --git a/src/sp-use.cpp b/src/sp-use.cpp index 648852961..abb59d299 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -442,7 +442,7 @@ void SPUse::move_compensate(Geom::Affine const *mp) { if(item){ item->transform *= m; Geom::Affine identity; - item->doWriteTransform(clip.getRepr(),item->transform, &identity); + item->doWriteTransform(item->transform, &identity); } } } @@ -452,7 +452,7 @@ void SPUse::move_compensate(Geom::Affine const *mp) { if(item){ item->transform *= m; Geom::Affine identity; - item->doWriteTransform(mask.getRepr(),item->transform, &identity); + item->doWriteTransform(item->transform, &identity); } } } @@ -482,7 +482,7 @@ void SPUse::move_compensate(Geom::Affine const *mp) { if(item){ item->transform *= clone_move.inverse(); Geom::Affine identity; - item->doWriteTransform(clip.getRepr(),item->transform, &identity); + item->doWriteTransform(item->transform, &identity); } } } @@ -492,7 +492,7 @@ void SPUse::move_compensate(Geom::Affine const *mp) { if(item){ item->transform *= clone_move.inverse(); Geom::Affine identity; - item->doWriteTransform(mask.getRepr(),item->transform, &identity); + item->doWriteTransform(item->transform, &identity); } } } @@ -500,7 +500,7 @@ void SPUse::move_compensate(Geom::Affine const *mp) { // commit the compensation this->transform *= clone_move; - this->doWriteTransform(this->getRepr(), this->transform, &advertized_move); + this->doWriteTransform(this->transform, &advertized_move); this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } @@ -742,7 +742,7 @@ SPItem *SPUse::unlink() { { Geom::Affine nomove(Geom::identity()); // Advertise ourselves as not moving. - item->doWriteTransform(item->getRepr(), t, &nomove); + item->doWriteTransform(t, &nomove); } return item; -- cgit v1.2.3 From 8761f46f7b8c2a2df82203f5be89d60072998a82 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Mon, 2 Oct 2017 02:12:27 +0200 Subject: Second batch --- src/sp-use.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/sp-use.cpp') diff --git a/src/sp-use.cpp b/src/sp-use.cpp index abb59d299..fae442cfa 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -356,22 +356,21 @@ Geom::Affine SPUse::get_root_transform() { //track the ultimate source of a chain of uses SPObject *orig = this->child; - GSList *chain = NULL; - chain = g_slist_prepend(chain, this); + std::vector chain; + chain.push_back(this); while (dynamic_cast(orig)) { - chain = g_slist_prepend(chain, orig); + chain.push_back(dynamic_cast(orig)); orig = dynamic_cast(orig)->child; } - chain = g_slist_prepend(chain, orig); - + chain.push_back(dynamic_cast(orig)); // calculate the accummulated transform, starting from the original Geom::Affine t(Geom::identity()); - for (GSList *i = chain; i != NULL; i = i->next) { - SPItem *i_tem = reinterpret_cast(i->data); + for (auto i=chain.rbegin(); i!=chain.rend(); ++i) { + SPItem *i_tem = *i; // "An additional transformation translate(x,y) is appended to the end (i.e., // right-side) of the transform attribute on the generated 'g', where x and y @@ -385,8 +384,6 @@ Geom::Affine SPUse::get_root_transform() { t *= i_tem->transform; } - - g_slist_free(chain); return t; } -- cgit v1.2.3 From 01abd8ec977b4caae888b7e315c6c18ced52e74c Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Thu, 5 Oct 2017 17:56:20 +0300 Subject: Extract SPDimensions from spuse --- src/sp-use.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'src/sp-use.cpp') diff --git a/src/sp-use.cpp b/src/sp-use.cpp index fae442cfa..61e8002bb 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -43,11 +43,8 @@ SPUse::SPUse() : SPItem(), + SPDimensions(), child(NULL), - x(), - y(), - width(), - height(), href(NULL), ref(new SPUseReference(this)), _delete_connection(), @@ -581,21 +578,7 @@ void SPUse::update(SPCtx *ctx, unsigned flags) { childflags &= SP_OBJECT_MODIFIED_CASCADE; /* Set up child viewport */ - if (this->x.unit == SVGLength::PERCENT) { - this->x.computed = this->x.value * ictx->viewport.width(); - } - - if (this->y.unit == SVGLength::PERCENT) { - this->y.computed = this->y.value * ictx->viewport.height(); - } - - if (this->width.unit == SVGLength::PERCENT) { - this->width.computed = this->width.value * ictx->viewport.width(); - } - - if (this->height.unit == SVGLength::PERCENT) { - this->height.computed = this->height.value * ictx->viewport.height(); - } + this->calcDimsFromParentViewport(ictx); childflags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; -- cgit v1.2.3