summaryrefslogtreecommitdiffstats
path: root/src/sp-use.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2017-10-07 16:23:02 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2017-10-07 16:23:02 +0000
commit8ef6761023610724a1e78e8c82cef80fd92827df (patch)
treec96e0e7329cca62e5529ea6899d3f5f2a9ee8e53 /src/sp-use.cpp
parentFix a few draw-geometry-* icons (diff)
parentRefactoring: avoid duplicate code. (diff)
downloadinkscape-8ef6761023610724a1e78e8c82cef80fd92827df.tar.gz
inkscape-8ef6761023610724a1e78e8c82cef80fd92827df.zip
Merge branch 'refactoring' of gitlab.com:shlomif/inkscape
Diffstat (limited to 'src/sp-use.cpp')
-rw-r--r--src/sp-use.cpp21
1 files changed, 2 insertions, 19 deletions
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;